summaryrefslogtreecommitdiffstats
path: root/drkonqi/crashtest.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-05-25 19:34:47 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-05-25 19:34:47 -0500
commitc12a32aec01bb5f6956ecfcd086997322eb7ec68 (patch)
tree73339f13893838325653d34fa5b4f58055612049 /drkonqi/crashtest.cpp
parent013eed4fdc2587ac7752777484de3c8bd9c170e1 (diff)
downloadtdebase-c12a32aec01bb5f6956ecfcd086997322eb7ec68.tar.gz
tdebase-c12a32aec01bb5f6956ecfcd086997322eb7ec68.zip
Properly obtain threading debug information in TDE crash handler
Fix potential TDE crash handler lockup uncer certain circumstances Enhance crashtest program with three threads
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