summaryrefslogtreecommitdiffstats
path: root/src/kernel/qeventloop_x11_glib.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2013-05-14 19:34:10 -0500
committerTimothy Pearson <[email protected]>2013-05-14 19:34:10 -0500
commit4eba9b823832a5bab1acffeabc245b06fe113d75 (patch)
tree9ec81ead726a66066c6450c805beb8e233391a65 /src/kernel/qeventloop_x11_glib.cpp
parentbe8413249bb8a6d8dc2cfc693d9c1037284fd251 (diff)
downloadqt3-4eba9b823832a5bab1acffeabc245b06fe113d75.tar.gz
qt3-4eba9b823832a5bab1acffeabc245b06fe113d75.zip
Fix a number of threading data races
Add proper thread termination handler This partially resolves Bug 1508
Diffstat (limited to 'src/kernel/qeventloop_x11_glib.cpp')
-rw-r--r--src/kernel/qeventloop_x11_glib.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/kernel/qeventloop_x11_glib.cpp b/src/kernel/qeventloop_x11_glib.cpp
index 23162c7..2bf1f63 100644
--- a/src/kernel/qeventloop_x11_glib.cpp
+++ b/src/kernel/qeventloop_x11_glib.cpp
@@ -629,6 +629,10 @@ bool QEventLoop::gsourceDispatch(GSource *gs) {
bool QEventLoop::hasPendingEvents() const
{
+#ifdef QT_THREAD_SUPPORT
+ QMutexLocker locker( QApplication::qt_mutex );
+#endif // QT_THREAD_SUPPORT
+
extern uint qGlobalPostedEventsCount(); // from qapplication.cpp
return ( qGlobalPostedEventsCount() || ( (qt_is_gui_used && QApplication::isGuiThread()) ? XPending( QPaintDevice::x11AppDisplay() ) : 0));
}