summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
Commit message (Collapse)AuthorAgeFilesLines
* Fix to exit of adopted thread watcher in Windowsjian liang2012-02-281-7/+20
| | | | | | | | | | | | | | Don't register the thread handle and QThread object pointer to watch list for adopted thread watcher thread in Windows. Otherwise the watcher thread will never exit and can't clean up its own QThreadData and QAdoptedThread object. Task-number: QTBUG-23961 Change-Id: Ia84326cf3cfd978d2b003ccc1bb6861db950e899 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> (cherry picked from commit bf66eebbc28b1f405a49a68d3f6c341d433159ea)
* Fix potential race condition in data structure of adopted thread watcherjian liang2012-02-281-1/+3
| | | | | | | | | | | | | Fix potential race condition in data structure of adopted thread watcher in Windows. Since QVector is not thread safe, it is not safe to read and append data to qt_adopted_thread_handles or qt_adopted_qthread simultaneously in qthread_win.cpp. This patch fix this race condition. Change-Id: I2d0c7a4cdde5390d38d15c98343f0fc6ddd24aba Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> (cherry picked from commit 4b30882a3f74914156f165a0a062b54ad3686c45)
* Allowing symbian cleanup code in thread started and finished slotsMurray Read2012-02-221-2/+10
| | | | | | | | | | | | | | | The run() function of QThread was inside a TRAP, but the started() and finished() signals were emitted outside of a TRAP so could not contain Symbian cleanup stack code. This broke compatability with some apps, as the older pthread based implementation had the whole main thread function running inside a TRAP. The started and finished signals are now emitted inside TRAPs, with enhanced leave/exception handling code. Task-number: ou1cimx1#979704 Change-Id: I9b4e50b1085494b5fd5e05efa11739ce19ff26fb Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
* Raise loopLevel for deleteLater in event filtersJohn Stanley2012-02-101-0/+11
| | | | | Change-Id: I163f510f6e99d86a35cc78965fa383e7f4618f42 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-1130-30/+30
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QThreads on Symbian are named to allow them to be opened externallymread2012-01-041-1/+17
| | | | | | | | | | | | | | | | | The Qt 4.7 implementation of QThread on Symbian used libpthread. This automatically generated a random name for a thread. The Qt 4.8 implmentation was leaving threads unnamed. This is a change in behaviour, in that unnamed/anonymous threads cannot be opened outside of the owning process. This was causing a bug in some client/server situations. The fix is to generate a name for the RThread underlying the QThread as follows: QThread object name + QThread object address + random number Task-number: ou1cimx1#959586 Reviewed-by: Shane Kearns
* Symbian: improving diagnostics for QWaitConditionmread2011-12-081-1/+4
| | | | | | | | | | | | | | | | | If a QWaitCondition was deleted while it was waiting, it would crash in the wait() function while trying to use its internal mutex. This crash is not particularly obvious in its cause. QWaitCondition can detect this delete-while-waiting case, issue appropriate warnings and avoid a crash in its internal state. In the app crash case where this problem was found, there is a further crash after this one due to an externally deleted mutex. The app is clearly at fault. But at least there's now more debug info about what the app is doing wrong. Task-number: ou1cimx1#946509 partial fix Reviewed-by: Shane Kearns
* Fix performance regression on Mac OS X when creating/destroying QMutexBradley T. Hughes2011-10-212-51/+7
| | | | | | | | | | | | This reverts commit cf17b743d2fe84ab259b7232ab07b58a1872e18e, which changed QMutex to use a Mach semaphore_t on Mac OS X. We now use pthread_mutex_t on Mac OS X as well. Contention performance is mostly unchanged, but the new constructionQMutex() benchmark added in this commit shows that creating/destroying a semaphore_t is about 20 times slower than pthread_mutex_t. Reviewed-by: Olivier Goffart Reviewed-by: João Abecasis
* Fix missing clean up stack panic for a new thread in SymbianTomi Vihria2011-09-151-2/+3
| | | | | | | | The clean up stack for a new thread was created in a too late phase for a process that doesn't have symbianVersion string in its cache Task-number: QT-5269 Reviewed-by: Murray Read
* Fix the timeout calculation again.Thiago Macieira2011-07-221-2/+2
| | | | | | | | | | | | The commit 412ef92162f8874a1585221125c31ef5f8ccc9cb introduced a fix, but the fix was incomplete. Fix it for good. Change-Id: I3e7fbdb294f8e960fbbf2e830790750240ed813a Merge-request: 30 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com> Reviewed-on: http://codereview.qt.nokia.com/1991 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> (cherry picked from commit 038d7c6c3b9815068e1f5b6df12625181f0313e1)
* Fix the timeout calculation for futexes in QMutex.Thiago Macieira2011-07-151-6/+22
| | | | | | | | | | | | | Recalculate how much time is remaining. This commit needs to be backported to 4.8. Change-Id: Ib587335bb90306e65969bb26256fb388f8f6bd24 Merge-request: 20 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com> Reviewed-on: http://codereview.qt.nokia.com/1666 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> (cherry picked from commit 412ef92162f8874a1585221125c31ef5f8ccc9cb)
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging into ↵Qt Continuous Integration System2011-06-271-0/+21
|\ | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging: Make it compile with openssl 1.0.0d, gcc 4.6 QStringBuilder: do not crash with null char* Fix event delevery order QSocketNotifier autotest - fix compile with MSVC
| * Fix event delevery orderOlivier Goffart2011-06-271-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some functions (such as QObject::moveToThread) did not keep the event ordered by priority. And because qUpperBound is used to add events, that mean new events would not be inserted in order. Task-number: QTBUG19637 Change-Id: I38eb9addb1cdd45b8566e000361ac6e5f1f2c2b8 Reviewed-on: http://codereview.qt.nokia.com/733 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com> (cherry picked from commit 7eeabcf70db658bca847498f618a94a375c95f5f)
* | Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7Liang Qi2011-06-241-0/+6
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qpixmap_raster_symbian.cpp src/gui/image/qpixmapdatafactory.cpp src/gui/painting/qgraphicssystem.cpp src/gui/styles/qs60style.cpp src/network/bearer/qnetworkconfigmanager_p.h src/s60installs/bwins/QtGuiu.def src/s60installs/bwins/QtOpenGLu.def src/s60installs/bwins/QtOpenVGu.def src/s60installs/eabi/QtGuiu.def src/s60installs/eabi/QtOpenVGu.def tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
| * QTBUG-17776, reporting terminated threads as not running on Symbianmread2011-06-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Symbian app shutdown all threads are terminated and their stack memory is released, but there is no time for notification of exit of these threads. So any attempt to access stack data in such a thread from static data destruction will cause a crash. This was happening with the XmlQuery thread. It was testing if the thread was still running, and QThread thought it was because there was no notification. So when the XmlQuery thread was asked to exit, and QThread::exit tried to access a stack based QEventLoop, there was a crash. By adding a test if the thread has been terminated to QThread::isRunning(), clients can now rely on this to know that it is safe to call exit() on a thread. The existing code is made safe again. Task-number: QTBUG-17776 Reviewed-by: Shane Kearns
| * Update licenseheader text in source filesJyri Tahtela2011-05-1327-452/+452
| | | | | | | | | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* | Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2011-06-221-0/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: trivial: fix typo in comment changelog docu update for QNX 6.5 get rid of anacronysm massive improvements for the QNX screen driver massive improvements for the QNX mouse driver massive improvements for the QNX keyboard driver disable the Embedded Linux data directory permissions check for QNX skip two subtests that are known to fail on QNX implement POSIX IPC based QLock, QWSLock and QWSSharedMemory backends implement POSIX IPC based QSystemSemaphore and QSharedMemory backends add a configure-time check for an IPC support make QProcess really work on QNX make the kernel attempt to emulate an instruction with a misaligned access use RoundRobin scheduler by default on QNX a major refactoring of the mkspecs tree for QNX buildfix for qmake
| * | use RoundRobin scheduler by default on QNXRitt Konstantin2011-06-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | otherwise drawn intensive apps will hog the cpu and make the system appear frozen Merge-request: 1259 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
* | | Merge branch '4.8' of scm.dev.nokia.troll.no:qt/qtDavid Boddie2011-06-171-1/+9
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/src/declarative/righttoleft.qdoc examples/draganddrop/fridgemagnets/main.cpp examples/script/context2d/main.cpp
| * | | QTBUG-19883 Adding top level TRAP for QThreads on Symbianmread2011-06-151-1/+9
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The native Symbian implementation of QThread in Qt4.8 does not have a top level TRAP, whereas it did in pthreads based implementation in Qt4.7. This causes an incompatibility in the form of a EUSER-CBASE:66 panic for code that attempts to use the cleanup stack without a TRAP of its own. This adds a top level TRAP and std::exception handler to match it and prints out warning information if they ever trigger to provide some diagnostic information which would otherwise be lost. Task-number: QTBUG-19883 Reviewed-by: Laszlo Agocs
* | | Merge branch '4.8' of scm.dev.nokia.troll.no:qt/qtDavid Boddie2011-05-2430-508/+515
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | Conflicts: src/gui/text/qrawfont.cpp src/gui/text/qtextlayout.cpp src/gui/util/qscroller.cpp src/gui/widgets/qlineedit.cpp
| * | Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-1330-503/+503
| | | | | | | | | | | | | | | | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
| * | Do not allow multiple threads to acquire a QMutexBradley T. Hughes2011-05-051-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the mutex optimizations on Mac, we did not handle the case where semaphore_wait() could return KERN_ABORTED. Under heavy contention, this happens, and when running in release mode, the assert in qmutex.cpp is not executed. The code silently allows multiple threads to continue as if it had acquired the mutex exclusively. Fix this by checking for KERN_ABORTED from semaphore_wait(), and retry the wait. We do not handle KERN_ABORTED for timed waits, simply return false and let the code doing the tryLock() handle it how it deems best. Reviewed-by: joao
| * | Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging into ↵Qt Continuous Integration System2011-05-051-0/+4
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging: Fix BlendBench::unalignedBlendArgb32 test case Fix memory leak in XSD component of XmlPatterns Added autotest for threaded text rendering. Implement support for enable_backup CONFIG value. Make text rendering working outside the gui thread on Symbian. Fix autotest failure in XmlPattern qxmlquery Fix memory leak bugs in XmlPatterns Symbian's QElapsedTimer::restart() fixed to return ms rather than us Create a cleanup stack for each new thread on Symbian. Do not modify window size for fullscreen windows in setGeometry_sys Fixed Qt UDA creation for Symbian Enablers for the Qt eclipsing in Symbian Improve logic to find default certificates in createpackage script Fix "make sis" for projects that have empty OBJECTS_DIR Add focus frame support in style sheet Fix OpenGL build break on Symbian
| | * \ Merge remote-tracking branch 'qt/4.8'Sami Lempinen2011-04-287-21/+72
| | |\ \
| | * | | Create a cleanup stack for each new thread on Symbian.Laszlo Agocs2011-04-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The native thread implementation in Qt 4.8 did not call CTrapCleanup::New() which resulted in E32USER-CBASE 69 panics in applications when they tried to use the cleanup stack in a thread's run() function. In 4.7 this was working because OpenC's pthread implementation created a CTrapCleanup automatically. Now we do it also in the native Symbian thread implementation. Trask-number: QTBUG-18822 Reviewed-by: Murray Read
* | | | | Doc: Applied pending fixes to API documentation.David Boddie2011-05-111-1/+2
|/ / / /
* | | | Merge branch '4.8-upstream'Thierry Bastian2011-04-281-0/+10
|\ \ \ \ | | |/ / | |/| |
| * | | Applying the QTBUG-17986 fix to Symbianmread2011-04-121-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change takes the QTBUG-17986 fix, which deletes QThreadData for adopted threads that have created QEventLoops, and applies it to qthread_symbian.cpp, which didn't exist at the time of the original fix. One complication is that Symbian uses a separate thread to monitor adopted thread lifetime, as there is no API to intercept thread exit to have cleanup code run within the context of the thread. However the cleanup for the thread involes deleting active objects that were created in the adopted thread, not the monitor thread. If these active objects are completed but not run, their cancellation could deadlock. In particular the wake up active object in the event dispatcher is typically in this state. We deal with it by detecting the situation and re-completing/cancelling the active object in the adopted thread monitor thread, which prevents deadlock and allows correct operation of the monitor thread. It is possible for this problem to affect other active objects owned by the event dispatcher. They symptom would be that finished signals from adopted threads are not sent, or they arrive much later than they should. Task-number: QTBUG-18622 Reviewed-by: Shane Kearns
| * | | Fix regression with Qt::AutoConnectionShane Kearns2011-04-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change df9491b302f6404ad2ccc6dc2eb3377176d994c6 optimised auto connections by comparing thread ID rather than comparing TLS addresses. However it was implemented on a branch that didn't have the native symbian threads. So merging the two branches caused a regression without merge conflicts. Reviewed-by: mread
* | | | Merge branch 'master-upstream'Thierry Bastian2011-04-1912-197/+974
|\ \ \ \ | |/ / /
| * | | Fix bad mergeOlivier Goffart2011-04-081-16/+0
| | | | | | | | | | | | | | | | | | | | Code was removed in that commit 834ad29849ebef99d7e5c516cde26d550abff7cd But the merge d54b3f04fa629fe031f1083073eef0145f0d6b1e reintroduced it back
| * | | Re-apply part of ba8e5eedf5f40091eb67dd391a7dcaf9299db2f5Olivier Goffart2011-04-081-0/+10
| | | | | | | | | | | | | | | | | | | | It was somehow lost in the merge of the native symbian threads (wrong merge was cf94df01d2d2364653f2ab602688394450e92d31)
| * | | Removed useless commentOlivier Goffart2011-04-071-3/+0
| | | | | | | | | | | | | | | | That call was removed in 0ee221b374ffef3657247be4c78e05689e04bef7
| * | | Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt into earth-masteraxis2011-04-077-169/+923
| |\ \ \ | | |/ / | | | | | | | | | | | | Conflicts: src/corelib/thread/qthread_unix.cpp
| | * | Moving Symbian CPU core detection to qthread_symbian.cppmread2011-03-182-30/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is resolving a merge issue where Symbian CPU core detection was added in one branch, but all the Symbian thread support was moved to a new file in another branch. Reviewed-by: Shane Kearns
| | * | Making Symbian helper threads exit cleanly at app exitmread2011-03-181-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idle detector thread and the adopted thread monitor thread could keep an app alive unnecessarily after main had exited, if the app's main thread was no longer set "process permanent". The idle detector thread now exits when the QCoreApplication is destroyed. The adopted thread monitor thread now exits when there are no more adopted threads to monitor. Task-number: QTBUG-18073 Reviewed-by: Shane Kearns
| | * | Merge remote branch 'qt-master/master'Guoqing Zhang2011-03-161-0/+26
| | |\ \ | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/thread/qthread_unix.cpp
| | * | | fixing build issue in qwaitcondition_symbian.cppmread2011-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include of qelapsedtimer was missing a .h Reviewed-by: Robert DeWolf
| | * | | fixing build error in qthread_symbian.cppmread2011-03-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CI found that an include of qsystemerror_p.h was incorrect Reviewed-by: iain
| | * | | Copying change to unix and Windows QThread implementation to Symbianmread2011-03-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During merge of SymbianLite branch, it was found that windows and unix QThread implementations had an identical change to locking on thread start. This change is now also applied to Symbian. Reviewed-by: iain
| | * | | Remerging SymbianLite to team repository.Sami Lempinen2011-03-091-1/+5
| | |\ \ \
| | * \ \ \ Merging SymbianLite branch to master.Sami Lempinen2011-03-097-164/+889
| | |\ \ \ \
| | | * | | | removing unused headersmread2011-03-093-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qdebug.h was only temporarily needed for debugging. errno.h is not needed for Symbian code. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | | * | | | Removing RFastLock usemread2011-03-092-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benchmarks showed no benefit from RFastLock vs RSemaphore. Since RSemaphore works on all target platforms, and RFastLock does not, there is no benefit in using RFastLock. So to simplify the code, it is removed. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | | * | | | Making RFastLock work for QMutexmread2011-03-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It needed an initial lock to make it behave like a semaphore. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | | * | | | further review fixes for qthread_symbian.cppmread2011-03-091-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed a call to get the symbian thread handle when we already had it. Improved error reporting on failure. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | | * | | | Symbian adopted thread monitor review fixesmread2011-03-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The adopted thread monitor could cause a stray event panic if multiple threads where added quickly. A new autotest was written to force the fault (successfully). A fix was then added. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | | * | | | Improving init_symbian_thread_handlemread2011-03-091-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From review comments on QThread_Symbian.cpp. init_symbian_thread_handle now opens the thread with process wide ownership directly, rather than going through an intermediate Duplicate. Retested QTBUG-13612 test case, which originally caused that function to be written. tst_qthread passes. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | | * | | | QMutex symbian review changesmread2011-03-092-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improved documentation Added a trywait(0) test and fixed the bug it found Symbian implementation throws on construction fail Task-number: QTBUG-13990 Reviewed-by: Shane Kearns