summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
Commit message (Collapse)AuthorAgeFilesLines
* Updated year in copyright headerKai Koehne2014-03-2630-30/+30
| | | | | | | | | | | | | | | | | | 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>
* Doc: Update, and reduce duplication of, QThread-related infoSze Howe Koh2014-03-131-14/+15
| | | | | | | | | | | | | | | | | | | | | | Added/Changed: - Move content from the Thread Basics overview to the QThread class ref - Rephrase bits for clarity - Use more links Removed: - (threads-basics.qdoc) Warning against moveToThread(this): This usage came about when people tried to add slots to a QThread subclass. This patch adds a warning against the root cause. - (threads-basics.qdoc) The strategy for managing member variables: Sounds error-prone. Pushing results through signals is safer. - (qthread.cpp) The note about GUI classes: Irrelevant to QThread, and it's already mentioned elsewhere. This is a cherry-pick from a9d5627e6a7b82 in qtbase.git. Change-Id: I491f64f998050daf0251abb2126bc9f7a198c17d Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* qthread_win.cpp: Fix warnings when waiting for adopted threads.Friedemann Kleint2014-01-091-1/+5
| | | | | | | | | Task-number: QTBUG-35591 Change-Id: I63169bd8a9758a7dad33d4231d3d6c9d71c7e252 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from qtbase/d1f8a5641615eb83bb36b4ada5913531d0da24f1) Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Don't use Standard Library routines in qthread_p.hThiago Macieira2013-12-061-2/+10
| | | | | | | | | | | Just write the for loops by hand so we don't need to use the Standard Library. That's necessary to support a -no-stl build. This patch is not necessary in Qt 5 since Qt 5 does not have -no-stl. Task-number: QTBUG-35424 Change-Id: Id449d807eaf7350f1a668ef16d356a9e236c6058 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QThread: Fix link to snippet in documentationJonathan Liu2013-11-221-1/+1
| | | | | Change-Id: Ie27b3ae36dcf98cef4b612387aff448bc0421d29 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Threads: Fix mingw-gcc warning about 'cast to pointer from integer of ↵Kai Koehne2013-11-201-4/+4
| | | | | | | | | | | | different size' Use reinterpret_cast to convert from DWORD to pointer. Change-Id: I17a12940850aeb0bc27080725a18eb93fee72ff7 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> (cherry picked from qtbase/edfdaba696d94206794203f9621d7e3aa8e5ab26) Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* QObject: use per-thread storage for qFlagLocation()Marc Mutz2013-11-161-0/+22
| | | | | | | | | | | | | | | | | | | | | qFlagLocation() uses a global char* array to transport source location information from the connect() side to the metaobject side. The size of the array is 2 (two), which just about suffices for a single connect() statement. Obviously, if more than one thread makes a (_any_) connection at the same time, the data is useless and, worse, there's a data race. The non-reentrancy of qFlagLocations() cannot and need not be fixed, but use a per-thread flagged_locations array in QThreadData so threads don't disturb each other. Task-number: QTBUG-3680 Change-Id: If1797c60751f551694def69afee6fbe295bbe2d2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> (cherry picked from qtbase/c012ee2940bc087720b4aa0d257540921cf9a139) Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* fix namespaced buildOswald Buddenhagen2013-08-121-2/+2
| | | | | | Change-Id: I9d0a3cb08de5e91807da7f0358c83b6693ebd1ea Reviewed-by: hjk <hjk121@nokiamail.com> (cherry picked from qtbase/da55d48ad731ee2499467b3e93e11eb3b53df89d)
* Fix crash when re-creating QThreadData after initially destroying itTor Arne Vestbø2013-06-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We destroy the thread data for the main thread when the QCoreApplication is destructed, and then delete the pthread key for the thread data in the global static destructor function 'destroy_current_thread_data_key'. The user may have its own Q_DESTRUCTOR_FUNCTION though, which may or may not run after we've destroyed the key. If it runs after we've destroyed the key, we'll end up trying to re-create the tread-data, as expected, but set_thread_data() will fail to persist it, as pthread_setspecific is called with an invalid key. The result is an infinite recursion: ... 6 in QThreadData::current () at qthread_unix.cpp:216 7 in QObject::QObject (this=0x48e1b30, dd=@0x48e1b40, parent=0x0) at qobject.cpp:703 8 in QThread::QThread (this=0x48e1b30, dd=@0x48e1b40, parent=0x0) at qthread.cpp:396 9 in QAdoptedThread::QAdoptedThread (this=0x48e1b30, data=0x48e1af0) at qthread.cpp:120 10 in QAdoptedThread::QAdoptedThread (this=0x48e1b30, data=0x48e1af0) at qthread.cpp:130 11 in QThreadData::current () at qthread_unix.cpp:219 12 in QObject::QObject (this=0x48e1a20, dd=@0x48e1a30, parent=0x0) at qobject.cpp:703 ... To solve this, we reset current_thread_data_once when destroying the key, so that subsequent calls to pthread_once to potentially create the key will call create_current_thread_data_key once more. This means we'll leak the key for this particular use-case, since we don't end up calling pthread_key_delete a second time, but this leak is small and happens typically only for a short duration during application shutdown. Cherry-picked from qtbase/46667d604fb2ae11a87c0c075a3d2468d02f7bdb. Change-Id: Iffc372ca530a486cd3efc2237ab02468bdcb5c81 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clear the current thread data for the main threadThiago Macieira2013-06-164-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | This avoids crashes accessing deleted memory when creating a QObject after the last QObject had been deleted, like a qDebug() in global destructors. ==41000== Invalid read of size 4 ==41000== at 0x5F01ED5: bool QBasicAtomicOps<4>::ref<int>(int&) (qatomic_x86.h:208) ==41000== by 0x5F01309: QBasicAtomicInteger<int>::ref() (qbasicatomic.h:147) ==41000== by 0x5F24051: QThreadData::ref() (qthread.cpp:100) ==41000== by 0x614A984: QObject::QObject(QObject*) (qobject.cpp:681) ==41000== Address 0x6ee73f0 is 0 bytes inside a block of size 152 free'd ==41000== at 0x4A0736C: operator delete(void*) (vg_replace_malloc.c:480) ==41000== by 0x5F240BF: QThreadData::deref() (qthread.cpp:109) ==41000== by 0x6113F6B: QCoreApplicationData::~QCoreApplicationData() (qcoreapplication.cpp:268) The comment right above the change in qthread.cpp looks eerily similar to the problem I'm trying to fix. However, the actual change that introduced the change is not in the Qt public history, so we can't know for sure what the problem was then. Cherry-picked from qtbase/950b35cf97ad398f97883efd2a18ee97994a8a9c. Change-Id: Ic4072c15529e2ae94ea36fbd0340cf5ee61413d2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make Qt 4.8 also compile with the LSB SDK on LinuxThiago Macieira2013-05-062-8/+8
| | | | | | | | | | | 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>
* QThreadDataPrivate: fix data race on canWait boolean.David Faure2013-04-231-0/+6
| | | | | | | | | | postEvent() accesses it with the postEventList mutex locked, but processEvent() was checking it without any mutex locked. Change-Id: I31bbb50f7a1c337067b8e3de16ee7cd11400b517 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from qtbase/bf3a5ccef13d568662f027be62280aba1f73bada) Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Added support for multicore CPUs in QThread::idealThreadCount for INTEGRITY ↵Florian Behrens2013-04-091-1/+7
| | | | | | | | | | target. Cherry-picked from qt5 commit 90361fd36c803c4c5c28d67f05ed66f619e0d39c. Change-Id: If13954d40d07aebf08b9a143964038c0996c325f Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThread::isFinished should return true from finished()Olivier Goffart2013-03-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | and isRunning() should return false. This restore the Qt 4.7 behaviour In Qt 4.7, the finished() was called with the thread's intenal mutex locked. Which mean that: - Call to isRunning or isFinished called from a slot connected to finish within the thread would deadlock. (Hence no compatibility to keep here) - Call to isRunning or isFinished from a slot connected with QueuedConnection in another thread would lock the mutex until the destructors are finished. and then return as if the thread have finished. Change-Id: I963eccae8f7634aff90cc4bbab6ca886a78e35eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry-picked from qtbase commit ec5e59b73c20a7dc6aec96c829f1e53c3fa58c07) Task-number: QTBUG-30251 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QThread documentation: do not discourage the reimplementation of QThreadSze Howe Koh2013-02-191-38/+24
| | | | | | | | | | | | | | | | | | | | | The new QThread documentation now really discourage to reimplement QThread. But in fact, there are many cases where it is perfectly fine. And the example given is even a case where using worker object is wrong. The examle even contains a leak since the thread will never stop and will even leak. This changes put back some sentences from before commit 207f588b6896cbe72745037dc1cb0a3aef1cf6d0. The sample code has been re-writen. Notice how reimpementing run takes less lines of code, less runtime overhead, no leaks, and also is more complete than the previous example. This is a modified backport of qtbase commit 91e12dca757a8ef5c4691b70eb80db61a9d47e83 Change-Id: I4932aef00307a6cf91d57d632a02b8a85e5e8845 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Use sched_get_priority_* functions only for SCHED_RR and SCHED_FIFOPasi Petäjäjärvi2013-01-281-2/+14
| | | | | | | | | | In VxWorks set default values for scheduling priority to use SCHED_FIFO_HIGH_PRI and SCHED_FIFO_LOW_PRI defines for other scheduling policies than SCHED_RR or SCHED_FIFO. Change-Id: If78b84cd9ef94d7712206e9442e96cdba727610f (cherry picked from qtbase/eae8faabed151fd32219f2f333fb632c104c73a7) Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-1330-30/+30
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Document how to name threads.Mitch Curtis2012-11-281-0/+8
| | | | | Change-Id: Ia79f5dd4a55d5260032781eab2f74737d65729f2 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Update QThread class ref to reflect changes since Qt 4.4Sze Howe Koh2012-10-201-55/+96
| | | | | | | | | | | | | | | | | Remove advice to subclass QThread; promote thinking of QThread as a thread manager, not a thread; promote event-driven programming over time micromanagement; warn against common pitfalls. Result of collaboration in forum (https://qt-project.org/forums/viewthread/20691/) and mailing list (http://lists.qt-project.org/pipermail/development/2012-September/006738.html) This is a modified backport of qtbase commit d4ad9dbbf96884c0899e8f8116a8a056facd52d5 Task-number: QTBUG-16358 Change-Id: Ib7a8d40aa418b1d96e3e7070df074b396ae9ee7e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix g++/MinGW compiler warnings.Friedemann Kleint2012-09-291-1/+1
| | | | | | | | | | - Assigned/Unused variables. - Unsigned comparison >= 0 is always true. - Constructor initialization order. - Signed/Unsigned comparisons. Change-Id: I1f9edab0506573420ed0bf3055252ba48625c8eb Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2930-710/+710
| | | | | | | | 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>
* Refactor coreservices -> ios & QT_NO_CORESERVICES -> Q_OS_IOSIan Dean2012-09-181-2/+2
| | | | | | | Similar work was done in Qt5 in Change Id3b02316 Change-Id: I392d2a5bfffb9a335f28d5dbc5ea27b800fc4487 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Allow compilation on OS X 10.5Sean Harmer2012-09-051-4/+5
| | | | | | | | | | Fixes regression introduced by aa21fcac3672cc6f0dca064b34bbe02ca4f4def7 Change-Id: Iada496dd8fee390771d8fc12066e93ef086dee90 Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: Juhani Taipale <juhani.taipale@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Display QThread name for debugging.Sean Harmer2012-08-301-0/+30
| | | | | | | | | | | Backport of commits: fb62fdac1cdb4e26388b5bacc7422ec4579b217e fe7c600fabdfb1b4cbad624ce7cb736e5edce86d 3ef51efbe75bfb9f1dfbe7df073e9eb745a72ad8 47fd7128dba4c38ff1bfcc517fec0f063fb90e4c Change-Id: Ibcb13ebb2e6cb05ab381328228eca5abdde52ad9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update contact information in license headers.Sergio Ahumada2012-08-0130-60/+60
| | | | | | | | | | | | | - 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>
* Removing potential crashes from out-of-thread cleanup on SymbianMurray Read2012-06-211-3/+35
| | | | | | | | | | | | | | | | | | | | There have been some crashes seen on Symbian when its adoptedThreadMonitor attempts to clean up objects created in other, now dead, threads. Some of these objects simply can't be cleaned up properly outside of their original thread, so the thread has to be checked when they are cleaned up, and cleanup skipped in the wrong thread. For pthread created threads, we also have the ability to insert cleanup code during thread shutdown. This was used in the 4.7 implementation of QThread on Symbian, and is a better solution for pthread based adopted threads as it gives in-thread cleanup. So the appropriate pthread code is also used with changes to adoptedThreadMonitor so that it can run along side the pthread cleanup code. Change-Id: Iad8207879b1ece62e5cce85f26a616166aa22486 Reviewed-by: Juha Kukkonen <ext-juha.kukkonen@nokia.com> Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>
* Fix QThread start failure due to bad thread name on SymbianJuha Kukkonen2012-04-251-1/+10
| | | | | | | | | | | | | | | | | | RThread::Create() deems a thread name to be invalid, if it contains any of the characters: "*", "?", ":" or character is outside 0x20 - 0x7e range. This matches to the logic in User::ValidateName() that is used by RThread::Create() to validate thread name. In addition, maximum thread name length is 80 character on Symbian. It was possible that thread name contained e.g. colon that caused RThread::Create() to fail with KErrBadName (-28). Fix ensures that thread name contains only allowed characters. Task-number: ou1cimx1#996187 Change-Id: Ie6dd8c60bfed4e2f6cc48607ff0ff940d9cdae8a Reviewed-by: Murray Read <ext-murray.2.read@nokia.com> Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>
* Integrate Blackberry Platform Services (BPS) with Qt event loop.Jeff Kehres2012-04-251-4/+13
| | | | | | | | | | | | | This ensures interoperability between the Blackbery C and C++ APIs and makes it easier to expose platform services in C++ that are exposed in BPS - since events from both APIs can be processed on the same thread. Backport of qtbase 0723e14699704c35d5d61fa7f5e9f3bdbb378afa Change-Id: Ie0d66e7f9b9984ad3acff61f01665a2b90ef40db Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Give QThread threads better names on SymbianMurray Read2012-03-271-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | QThread sets the name of a Symbian thread that it creates. This name can appear in a number of debugging scenarios, and it can give useful information. However the existing name set by QThread has not been informative. This change improves the amount of information in the thread name. Threads are now named as: <object name>_<class name>_v=<class vptr>_<random> The class name and vptr can be used to identify the QThread subclass type. In the case of a QThread subclass that generates a .moc file, the class name will be the true class name. However for other cases, eg where QThread is used directly, or is subclassed without a QOBJECT declaration, the name may simply be "QThread", and the vptr field might then be more informative. This change also allows the use of RTTI to get the true class name, through a rebuild of Qt, defining the macro name QT_USE_RTTI_IN_THREAD_CLASSNAME. This is not enabled by default, as there may be Symbian cases where RTTI does not work. Task-number: QTBUG-24950 Change-Id: Ifae9c6cb64638e95a01d34e421aa36f6fd0e7444 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
* 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