summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | | * | | | Trigger for using RFastLockmread2011-03-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __SYMBIAN_KERNEL_HYBRID_HEAP__ is not directly related to RFastLock's timed wait functions, but it was added at about the right time so is effective. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | | * | | | Using a single monitor thread to monitor all adopted threadsmread2011-03-091-86/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reduces the number of extra threads required when native threads are adopted. In practice, the main thread is native and the montitor thread itself, so the monitor thread always ends up monitoring both. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | | * | | | Attempt to have one thread for all adopted thread monitoringmread2011-03-091-23/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compiles, not tested yet. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | | * | | | Removed unnecessary ref() on QThreadDatamread2011-03-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbian's QThreadPrivate::start had a ref() on QThreadData which was causing it to never be deleted. This made sense in Unix, where there was always a deref in the thread cleanup. But this does not happen in Symbian. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | | * | | | Fixed thread priority codemread2011-03-092-28/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The thread priority setting code was not dealing with the inherit case correctly. Now that it is, the wait condition delay hack has been removed. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | | * | | | Native adopted thread lifetime monitoringmread2011-03-091-75/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | | * | | | Symbian native implementation of corelib/threadmread2011-03-097-158/+891
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QThread, QWaitCondition and QMutex have new Symbian native implementations. These new implementations are split out into new _symbian files. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| * | | | | | Optimize QMutexPoolOlivier Goffart2011-03-312-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the get() function inline and simplify the hash computation Reviewed-by: brad
| * | | | | | Optimize QMetaObject::activate (remove call to QThreadData::current)Olivier Goffart2011-03-314-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QThreadData::current is too slow, it needs to access the TLS The currentThreadId is much faster. Reviewed-by: Brad
| * | | | | | Fix the leak of QAdoptedThread and all dependent objectsOlivier Goffart2011-03-284-6/+27
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if there is a QEventDispatcher in QAdoptedThread. QAdoptedThread is supposed to be destroyed when the QThreadData is destroyed. But QThreadData is ref-counted, and QEventDispatcher holds a reference to it. QEventDispatcher is supposed to be destroyed in QThreadPrivate::finish, which is supposed to be called from the destructor of QAdoptedThread. There is a circular dependence. We break it by calling finish in the callback that is called when the thread is finished. Task-number: QTBUG-17986 Reviewed-by: Brad