summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_unix.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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-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>
* 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>
* 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>
* 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>
* 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
* 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)
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt into earth-masteraxis2011-04-071-154/+4
|\ | | | | | | | | Conflicts: src/corelib/thread/qthread_unix.cpp
| * Moving Symbian CPU core detection to qthread_symbian.cppmread2011-03-181-26/+0
| | | | | | | | | | | | | | | | 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
| * Merge remote branch 'qt-master/master'Guoqing Zhang2011-03-161-0/+26
| |\ | | | | | | | | | | | | Conflicts: src/corelib/thread/qthread_unix.cpp
| * \ Merging SymbianLite branch to master.Sami Lempinen2011-03-091-148/+3
| |\ \
| | * | Symbian native implementation of corelib/threadmread2011-03-091-142/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 QMetaObject::activate (remove call to QThreadData::current)Olivier Goffart2011-03-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-281-2/+11
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7Thiago Macieira2011-03-111-2/+25
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Conflicts: mkspecs/common/symbian/symbian.conf src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtGuiu.def
| * | Cast int to HALData::TAttribute for QT_HALData_ENumCpus and compile with RVCT4.Liang Qi2011-03-101-1/+1
| | | | | | | | | | | | | | | Reviewed-by: Jani Hautakangas Reviewed-by: Shane Kearns
| * | Get the number of cores from HAL on Symbian.Liang Qi2011-03-101-2/+25
| | | | | | | | | | | | | | | Task-number: QTBUG-2199 Reviewed-by: Shane Kearns
* | | Fix race condition between QEventLoop::exec and QThread::exitOlivier Goffart2011-02-071-1/+4
| | | | | | | | | | | | | | | | | | | | | As also mentioned in QTBUG-16692 Reviewed-by: brad Task-number: QTBUG-17257
* | | Implement QThreadData::current using __threadOlivier Goffart2011-02-031-3/+20
| |/ |/| | | | | | | | | | | It slightly faster, and QThreadData::current is used everywhere Reviewed-by: mread Reviewed-by: Joao
* | 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
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-11-251-4/+9
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/symbian/symmake.cpp src/corelib/global/qglobal.h src/gui/kernel/qwidget_p.h src/gui/painting/qtextureglyphcache.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h src/plugins/qpluginbase.pri src/qbase.pri tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp tests/auto/qthread/tst_qthread.cpp tests/auto/selftests/expected_cmptest.txt tests/auto/selftests/expected_crashes_3.txt tests/auto/selftests/expected_longstring.txt tests/auto/selftests/expected_maxwarnings.txt tests/auto/selftests/expected_skip.txt tools/assistant/tools/assistant/doc/assistant.qdocconf tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qdeclarative.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf tools/qdoc3/test/qt.qdocconf tools/qdoc3/test/qt_ja_JP.qdocconf tools/qdoc3/test/qt_zh_CN.qdocconf
| * Compile on OpenBSDOlivier Goffart2010-11-221-3/+10
| | | | | | | | | | | | Fail to compile since f3405a516ac30fc7dee1 Reviewed-by: Joao
* | QThread: fix a race condition when destroying or restarting thread from ↵Olivier Goffart2010-11-241-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | finished() Since we do not keep the mutex locked in QThreadPrivate::finish, We could have races if the thread is destroyed or restarted from another thread while we are still in that function This solve tst_QCoreApplication::deliverInDefinedOrder on mac Regression since a43583e0221311b7fe666726a Reviewed-by: Brad
* | Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-11-221-16/+20
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: optimize ligatureHelper by using qBinaryFind instead of the for loop QFileSystemWatcher: Do not require QApplication in the destructor. Do not define METHOD if QT_NO_KEYWORD is defined. QThreadPrivate::finish should not keep mutex locked when calling signals Make QThreadStorage supports value type and not only pointers. QThreadStorage: fix memory leak if thread storage are added while destroying Compile fix. Fix some warnings on Mac
| * | QThreadPrivate::finish should not keep mutex locked when calling signalsOlivier Goffart2010-11-221-16/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix the deadlock shown in the new test wait3_slowDestructor Add a test for QThread::wait(timeout) Task-number: QTBUG-15030 Reviewed-by: Joao Reviewed-by: Brad
* | | Revert "Don't destroy Qt's internal pthread_key_t if it was not initialized"Bradley T. Hughes2010-11-221-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8c31c6529935cd9ee6f99bc38cfd182d5b3182e2 due to a regression in the QThreadStorage autotest. Fix the problem another way: call pthread_once() in the destructor function to ensure that we always call pthread_key_delete() on a key we created.
* | | Compile fixBradley T. Hughes2010-11-181-1/+0
| | | | | | | | | | | | | | | | | | | | | Remove the Q_UNUSED(), which uses template magic for some compilers, but some compilers don't accept local types as the template argument. Reviewed-by: trustme
* | | Don't destroy Qt's internal pthread_key_t if it was not initializedBradley T. Hughes2010-11-181-7/+9
|/ / | | | | | | | | | | | | | | | | | | | | | | | | The destructor function destroy_current_thread_data_key() was always called on library unload, even if the pthread_key_t was not initialized. This can cause us to destroy a key that doesn't belong to us, as pointed out in the task below. Fix this by creating a function static instance of a class whose destructor will destroy the key. Task-number: QTBUG-10861 Reviewed-by: Morten Sørvig
* | Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-10-291-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Add autotest for QScriptExtensionPlugin Improve QtScript test coverage Don't crash when null-pointer is passed to qScriptValueFromValue() Simplify object lifetime management when moving objects to a QThread samegame: white space Move list of trusted benchmarks out of QA dungeon and into Qt Don't put Objective-C sources in SOURCES mkspecs: Emit warning when including g++.conf directly
| * | Simplify object lifetime management when moving objects to a QThreadBradley T. Hughes2010-10-291-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation for Qt::AutoConnection states is a signal is emitted from the same thread as the receiving object, the connection should behave as Qt::DirectConnection. The actual behavior prior to this commit was different from the documentation; if the signal was emitted in a thread different from the sender's thread, then we would queue (which is now corrected). By making the behavior match the documentation, it is now possible to connect QThread's finished() signal to an object's deleteLater() slot and the slot will execute when finished() is emitted (previously it was queued). QObject::deleteLater() uses a posted QEvent::DeferredDelete event to trigger deletion of the object. In QThread, after emitting the finished() signal, we now send all pending DeferredDelete events to ensure that all pending deletions happen. We have precedence for this behavior, QCoreApplication::exec() does the same thing after emitting the aboutToQuit() signal. Reviewed-by: joao Reviewed-by: olivier
* | Merge remote branch 'qt/master' into lighthouse-masterPaul Olav Tvete2010-10-261-8/+38
|\ \ | |/ | | | | | | Conflicts: src/opengl/qwindowsurface_gl.cpp
| * Using TLS to store QThreadData on Symbianmread2010-10-211-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TLS access on Symbian is significantly faster than using pthread_getspecific. In the case of QThreadData, the data associated with a thread, it makes sense to store and access the pointer in TLS rather than using the pthread thread specific functions. However, the pthread thread specific function have some destructor functionality that Symbian TLS does not, so Symbian still uses the pthread functions for setting the QThreadData to get the destruction behaviour. This change has wide ranging performance benefits for QML execution. With improvements shown on a number of the declarative benchmarks. Frame drawing times on test apps are also showing some improvement. The qthread* autotests have been run on Symbian^3 and Ubuntu 10.10 Task-number: QT-4089 Reviewed-by: Shane Kearns
* | Merge remote branch 'lighthouse/4.7' into lighthouse-masterPaul Olav Tvete2010-10-221-1/+3
|\ \
| * | Lighthouse on OS X.Morten Johan Sørvig2010-10-201-1/+3
| | | | | | | | | | | | Reviewed-by: Jørgen
| * | Merge remote branch 'qt/4.7' into lighthouse-4.7Paul Olav Tvete2010-10-051-6/+31
| |\ \ | | |/ | | | | | | | | | Conflicts: src/gui/painting/qpdf.cpp
* | | Merge remote branch 'qt/master' into lighthouse-masterPaul Olav Tvete2010-10-051-0/+2
|\ \ \ | | |/ | |/| | | | | | | Conflicts: src/gui/painting/qpdf.cpp
| * | QThread: make sure start works even if called after exitOlivier Goffart2010-09-221-0/+2
| | | | | | | | | | | | | | | | | | | | | Regression in 4.7.0 introduced by 13ca61fcfdc53a6a06a Reviewed-by: brad Task-number: QTBUG-13810
* | | Merge branch 'master' of scm.dev.nokia.troll.no:qt/qtGunnar Sletta2010-09-271-6/+29
|\ \ \ | |/ / | | | | | | | | | | | | Conflicts: configure src/corelib/global/qglobal.h
| * | Do not wait for QThread exit when destroying global statics in SymbianMiikka Heikkinen2010-09-151-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbian kernel will kill all threads except the main one before running destructors on global static objects. Qt gets no notification of these thread terminations, so it'll still think those threads are running and will wait indefinitely for their exit. QThread::wait() now checks if the thread is actually still alive before starting to wait on thread_done wait condition. Task-number: QTBUG-13612 Reviewed-by: Janne Koskinen
* | | Compile on Symbian after commit 075e96eba5001Paul Olav Tvete2010-08-181-1/+1
| |/ |/|
* | Merge remote branch 'qt/4.7' into lighthouse-4.7Paul Olav Tvete2010-07-141-0/+8
|\ \ | |/ | | | | | | | | | | Conflicts: src/gui/image/image.pri src/gui/image/qpixmapdatafactory.cpp src/gui/painting/qgraphicssystem.cpp
| * Set QThreads to be process critical automatically on Symbian OSShane Kearns2010-07-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Symbian OS, a thread is non critical by default - this means if it crashes the process does not automatically terminate, rather it is allowed to handle the crash by itself. Only the main thread is critical by default. Since this is not the behaviour on other platforms, application developers are unlikely to have considered this case - and would need to write symbian specific code to catch the crash. For such advanced users, they can reset the critical flag on the thread once they get control in QThread::run(). By default, a crash in any thread created via the QThread API will now crash the process. Reviewed-by: Iain
* | Say hello to Qt for Native Client.Morten Johan Sørvig2010-05-141-0/+2
|/ | | | | | | | | | | | | | This commits adds build system to support for the native client compiler (x86-only for now), sets up global defines, and adds compile fixes for QtCore and QtGui. Details: * Add mkspecs for linux-nacl-g++ and macx-nacl-c++ * Add nacl configure option * Add qconfig-minimal-system-dependencies.h * Define Q_OS_NACL in qglobal.h * Add qnacalunimplemented.h/cpp with POSIX stubs. * .pro file changes for cross-compiling on Mac
* Fix a crash when unloading libQtCoreBradley T. Hughes2010-04-081-0/+6
| | | | | | | | | | | | | | QThread will register a cleanup function with pthreads to be run when ever a thread exits. However, if QtCore is unloaded, this function would stay registered and the application would crash when a thread exits (since the function pointer registered with pthreads is no longer valid). Add a destructor function to qthread_unix.cpp which destroys the pthread_key_t and unregisters the cleanup function. Task-number: QTBUG-9436 Reviewed-by: Marius Storm-Olsen
* Implement Idle-priority threads for Linux.Thiago Macieira2010-03-171-45/+62
| | | | | | | | I don't know of any other systems that define SCHED_IDLE, but if any do, they'll use this code too Task-number: related to QTBUG-9032 Reviewed-by: Bradley T. Hughes