From 78125ea2f051107b84fdc0354acdedb7885308ee Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 6 Dec 2012 16:47:27 -0600 Subject: Add real threading support, including per-thread event loops, to QThread --- src/kernel/qeventloop_unix.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/kernel/qeventloop_unix.cpp') diff --git a/src/kernel/qeventloop_unix.cpp b/src/kernel/qeventloop_unix.cpp index b0ad8b9..202ef12 100644 --- a/src/kernel/qeventloop_unix.cpp +++ b/src/kernel/qeventloop_unix.cpp @@ -40,6 +40,7 @@ #include "qeventloop.h" #include "qapplication.h" #include "qbitarray.h" +#include "qmutex.h" #include #include -- cgit v1.2.1 From caf80d88243aaa00e8f1baeaa6b7e4c3aca75f63 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 6 Dec 2012 18:29:37 -0600 Subject: Add threading tutorial and fix a couple rare crashes --- src/kernel/qeventloop_unix.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/kernel/qeventloop_unix.cpp') diff --git a/src/kernel/qeventloop_unix.cpp b/src/kernel/qeventloop_unix.cpp index 202ef12..80c8f29 100644 --- a/src/kernel/qeventloop_unix.cpp +++ b/src/kernel/qeventloop_unix.cpp @@ -562,6 +562,8 @@ int QEventLoop::activateTimers() n_act++; QTimerEvent e( t->id ); QApplication::sendEvent( t->obj, &e ); // send event + if ( !timerList ) // sendEvent allows other threads to execute, therefore we must check for list existence when it returns! + return 0; if ( timerList->findRef( begin ) == -1 ) begin = 0; } -- cgit v1.2.1