summaryrefslogtreecommitdiffstats
path: root/drkonqi/crashtest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drkonqi/crashtest.cpp')
-rw-r--r--drkonqi/crashtest.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/drkonqi/crashtest.cpp b/drkonqi/crashtest.cpp
index 2583c1273..ff38fae24 100644
--- a/drkonqi/crashtest.cpp
+++ b/drkonqi/crashtest.cpp
@@ -1,11 +1,28 @@
// Let's crash.
+#include <unistd.h>
#include <tdeapplication.h>
#include <tdeaboutdata.h>
#include <tdecmdlineargs.h>
+#include <tqthread.h>
+#include <tqtimer.h>
#include <kdebug.h>
#include <stdio.h>
#include <assert.h>
+#include "crashtest.h"
+
+void WorkerObject::run()
+{
+ while (1) {
+ sleep(10000);
+ }
+}
+
+#define SET_UP_WORKER(x, y) \
+ WorkerObject x; \
+ x.moveToThread(&y); \
+ TQTimer::singleShot(0, &x, SLOT(run()));
+
static TDECmdLineOptions options[] =
{
{ "+crash|malloc|div0|assert", "Type of crash.", 0 },
@@ -74,6 +91,17 @@ int main(int argc, char *argv[])
TDEAboutData::License_GPL,
"(c) 2000-2002 David Faure, Waldo Bastian");
+ // Start 3 threads
+ TQEventLoopThread workerthread0;
+ TQEventLoopThread workerthread1;
+ TQEventLoopThread workerthread2;
+ SET_UP_WORKER(worker0, workerthread0)
+ SET_UP_WORKER(worker1, workerthread1)
+ SET_UP_WORKER(worker2, workerthread2)
+ workerthread0.start();
+ workerthread1.start();
+ workerthread2.start();
+
TDECmdLineArgs::init(argc, argv, &aboutData);
TDECmdLineArgs::addCmdLineOptions(options);
@@ -90,3 +118,5 @@ int main(int argc, char *argv[])
level1(crashtype);
return app.exec();
}
+
+#include "crashtest.moc" \ No newline at end of file