From c12a32aec01bb5f6956ecfcd086997322eb7ec68 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 25 May 2013 19:34:47 -0500 Subject: Properly obtain threading debug information in TDE crash handler Fix potential TDE crash handler lockup uncer certain circumstances Enhance crashtest program with three threads --- drkonqi/crashtest.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'drkonqi/crashtest.cpp') 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 #include #include #include +#include +#include #include #include #include +#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 -- cgit v1.2.3