summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qmutex_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright headersAkseli Salovaara2015-03-311-13/+13
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I7e3e96183e073877b46bc8071b2ccae19e69426b Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Updated year in copyright headerKai Koehne2014-03-261-1/+1
| | | | | | | | | | | | | | | | | | find . -path '*/3rdparty/*' -prune -o -type f -print | xargs -L1 sed -i -E 's/Copyright(.*) 2013 Digia/Copyright\1 2014 Digia/g' Manually patched files: demos/spectrum/3rdparty/fftreal/fftreal_wrapper.h demos/spectrum/3rdparty/fftreal/fftreal_wrapper.cpp src/3rdparty/s60/eiksoftkeyimage.h tools/qdoc3/test/qt-project.qdocconf tests/auto/qsharedpointer/nontracked.h tests/auto/qsharedpointer/nontracked.cpp Change-Id: I3f9074923b4d6bd4666258ab04f01476cc6e901c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make Qt 4.8 also compile with the LSB SDK on LinuxThiago Macieira2013-05-061-1/+1
| | | | | | | | | | | Generate worse code. This is similar to Qt5 commits 46bfd84fdc24fa3e3e721a5dda6cfbebe75be073 and c69106d1bf66d64e046c4f639542457151187dfc. Task-number: QTBUG-25336 Change-Id: Idd61c23d2b528db9d8c7895df008b9c1b0e2a2a4 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-131-1/+1
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-291-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Update contact information in license headers.Sergio Ahumada2012-08-011-2/+2
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-111-1/+1
| | | | | | | | | 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>
* Fix performance regression on Mac OS X when creating/destroying QMutexBradley T. Hughes2011-10-211-7/+1
| | | | | | | | | | | | 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
* Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-131-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Removing RFastLock usemread2011-03-091-12/+0
| | | | | | | | | | 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
* QMutex symbian review changesmread2011-03-091-0/+3
| | | | | | | | | 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
* Symbian native implementation of corelib/threadmread2011-03-091-1/+12
| | | | | | | | | 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
* Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Track average wait times under our maximum spin time thresholdBradley T. Hughes2010-12-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Further observation shows that spin times slightly over the average wait time produce the best results. This change keeps a heavily weighted average of the wait times under 1.5ms (1.5 times the max spin threshold), and adjusts the spin time to be 150% of the average wait time. Introduce spin time adjustments when spin locking works, and adjust to between 150% of the average wait time and the maximum threshold. Reviewed-by: joao
* | Store and track spin times in nanosecond resolutionBradley T. Hughes2010-12-201-3/+3
| | | | | | | | | | | | | | | | | | | | Use the new QElapsedTimer::nsecsElapsed() and store all values in qint64 instead of int. The maximum spin time threshold is now 1000000ns, or 1ms. Spinning for longer than 1ms is just a waste of time, CPU, and battery. Reviewed-by: joao
* | Optimize adaptive spinning mutex codeBradley T. Hughes2010-12-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the adaptive spinning code to be elapsed time based instead of iteration based. The new approach will quickly reduce the amount of allowed spinning time when it detects that lock contention is resolved by waiting instead of spinning. We get better results by dynamically adjusting for elapsed running time instead of trying to fine tune iteration counts that won't work for all CPU types, speeds, etc. From observation, lock performance suffers if the spin time is higher than the minimum wait time. Because of this, QMutex never increases the spin time, it only reduces the spin time to the minimum observed wait time. For very long wait times, we disable spinning completely (and always resolve contention by waiting). Use QThread::yieldCurrentThread() when spinning on a contended mutex. Comment from the code: be a good citizen... yielding lets something else run if there is something to run, but may also relieve memory pressure if not. Reviewed-by: joao
* | Improve QMutex contention performance on LinuxBradley T. Hughes2010-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use futex(2) to implement QMutexPrivate::wait() and ::wakeup(). This makes QMutex perform more or less identically the same as pthread_mutex_t when contended. We have to use the contender count in a different way due to the way that futex() waiting works. Waiting on a futex atomically checks that the value has not changed from the expected value and then puts the thread to sleep. So, on Linux, the contender QAtomicInt will only ever be one of three values: 0 for unlocked, 1 for locked, 2 for contended. This does mean that there is a slight chance for unfairness due to the fetch-and-store to zero in the wakeUp() function, but unfortunately this cannot be avoid as the code is now. Reviewed-by: joao
* | Improve QMutex contention performance on Mac OS XBradley T. Hughes2010-12-201-1/+7
| | | | | | | | | | | | | | | | Use a Mach semaphore to implement QMutexPrivate::wait() and ::wakeup(). This makes QMutex perform more or less identically the same as pthread_mutex_t when contended. Reviewed-by: joao
* | Removed QMutexPrivate::self() declarationBradley T. Hughes2010-12-201-1/+0
| | | | | | | | | | | | This function is not used or implemented anywhere. Reviewed-by: joao
* | Inline the common case when there is no contention.Olivier Goffart2010-05-181-3/+8
|/ | | | | | | | | | | | QMutex locking could be used in performence critical code (such as QObject and co.) where the cost of a function call is not neglectible. This would slow down the common case where there is only one thread and no contention. Since we need to keep the old symbol for binary compatibilty, introduce new *Inline function. Reviewed-by: Brad
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | Reviewed-by: Trust Me
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Update tech preview license header.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* Update license headers.Jason McDonald2009-08-111-1/+1
| | | | Reviewed-by: Trust Me
* Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
| | | | Reviewed-by: Trust Me
* Long live Qt 4.5!Lars Knoll2009-03-231-0/+88