summaryrefslogtreecommitdiffstats
path: root/tests/auto/qthread/tst_qthread.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QThread::isFinished should return true from finished()Olivier Goffart2013-03-191-0/+35
| | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* Fix QThread start failure due to bad thread name on SymbianJuha Kukkonen2012-04-251-0/+146
| | | | | | | | | | | | | | | | | | 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>
* Handling adopted thread death with active timers on SymbianMurray Read2012-02-081-0/+27
| | | | | | | | | | | | | | Timers are thread local objects on Symbian. When the adopted thread monitor tries to tidy up a thread, any existing qt timers will be cleaned up. But that has to be done very carefully without touching the underlying symbian timer objects. Checks are added to make sure the Symbian timers are only touched in the correct thread. Task-number: ou1cimx1#960478 Change-Id: If16750b455aa576aa9f2d93657a3627d18060272 Reviewed-by: Shane Kearns <ext-shane.2.kearns@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>
* Merge remote-tracking branch 'qt/4.8'Jyri Tahtela2011-05-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/src/examples/wheel.qdoc src/gui/util/qflickgesture.cpp src/gui/util/qflickgesture_p.h src/gui/util/qscroller.cpp src/gui/util/qscroller.h src/gui/util/qscroller_p.h src/gui/util/qscrollerproperties.cpp src/gui/util/qscrollerproperties.h tests/auto/qscroller/tst_qscroller.cpp
| * Merge remote branch 'origin/4.8' into qa-review-masterRohan McGovern2011-05-151-3/+82
| |\ | | | | | | | | | | | | | | | Conflicts: tests/auto/qaccessibility/tst_qaccessibility.cpp tests/auto/qsslsocket/tst_qsslsocket.cpp
| * | Remove Q_ASSERT from QThread autotestJason McDonald2011-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Report a meaningful fatal error instead of aborting in debug mode builds and failing silently in release mode builds. Change-Id: If9a6c0655e021b3bb6b7d894aefd9bbcc58e4605 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern
* | | 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 crash after merge of the native symbian thread branch.Olivier Goffart2011-04-081-1/+0
| | | | | | | | | | | | | | The memory leak was fixed in two different ways in b6c60b0c9778f51af8c80f853d840ba25910c6f4 and 0ee221b374ffef3657247be4c78e05689e04bef7 after the merge, the thread are now deleted twice.
* | Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt into earth-masteraxis2011-04-071-3/+66
|\ \ | | | | | | | | | | | | Conflicts: src/corelib/thread/qthread_unix.cpp
| * \ Merging SymbianLite branch to master.Sami Lempinen2011-03-091-3/+66
| |\ \ | | |/ | |/|
| | * removed some memory leaks from tst_qthreadmread2011-03-091-0/+2
| | | | | | | | | | | | | | | | | | | | | This now deletes nativeThread objects Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
| | * Symbian adopted thread monitor review fixesmread2011-03-091-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * tst_qthread now using RThread for Symbian native thread testingmread2011-03-091-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | It was using pthreads, but RThreads are the true native threads for Symbian, so switched to that. The test was passing with pthreads before this change, and is passing with RThreads after. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
* | | Fix the leak of QAdoptedThread and all dependent objectsOlivier Goffart2011-03-281-0/+17
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix race condition between QEventLoop::exec and QThread::exitOlivier Goffart2011-02-071-0/+16
|/ | | | | | | As also mentioned in QTBUG-16692 Reviewed-by: brad Task-number: QTBUG-17257
* 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-2/+39
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * tst_qthread: fix compilationOlivier Goffart2010-11-221-1/+2
| |
| * QThread::exec(): Fix possibility to enter several time the event loopOlivier Goffart2010-11-221-0/+40
| | | | | | | | | | | | | | | | | | | | | | If one call exit() before calling exec(), this should prevent the event loop from starting once, but later calls to exec() should work. This is a regression against Qt 4.6 introduced when fixing QTBUG-1184 Task-number: QTBUG-15378 Reviewed-by: Joao Reviewed-by: Brad
* | QThread: fix a race condition when destroying or restarting thread from ↵Olivier Goffart2010-11-241-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Doc: Fixing typoSergio Ahumada2010-11-231-1/+1
| |
* | QThreadPrivate::finish should not keep mutex locked when calling signalsOlivier Goffart2010-11-221-0/+77
| | | | | | | | | | | | | | | | | | | | 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
* | Simplify object lifetime management when moving objects to a QThreadBradley T. Hughes2010-10-291-0/+14
|/ | | | | | | | | | | | | | | | | | | | | | 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
* QThread: make sure start works even if called after exitOlivier Goffart2010-09-221-0/+41
| | | | | | | Regression in 4.7.0 introduced by 13ca61fcfdc53a6a06a Reviewed-by: brad Task-number: QTBUG-13810
* Don't deadlock tst_QThread::exit() and tst_QThread::quit()Bradley T. Hughes2010-04-191-2/+2
| | | | | | | | Make sure to lock the mutex before starting the threads... otherwise we run the risk of losing the wakeup between start() and the lock being acquired. Reviewed-by: TrustMe
* Fix tst_QEventLoop::exec() regression introduced by commit ↵Bradley T. Hughes2010-04-161-14/+18
| | | | | | | | | | | | | | | 816523117bc00cfeb17e347f7fe5f11278a5e871 The quitNow flag needs to be reset at the beginning of exec() to allow exec() to recurse and be run multiple times. This changes reverts commit 816523117bc00cfeb17e347f7fe5f11278a5e871 an introduces the QThreadPrivate::exited flag to fix the race between start() and exit(), and QThreadPrivate::returnCode to make sure exec() returns the code passed to exit(). Task-number: QTBUG-1184 Reviewed-by: olivier
* Fix a race where QThread::exit() is "lost" when called after start()Bradley T. Hughes2010-04-121-11/+36
| | | | | | | | | | | QThread::exit() tries to stop all running event loops, but does nothing if the eventloop has not started yet. This is often the case for short- exit method on an object that has affinity to the thread. This ensures that the exit is called from the running eventloop, meaning the exit() will never be lost. Task-number: QTBUG-1184 Reviewed-by: Morten Sørvig
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | Reviewed-by: Trust Me
* CompilePaul Olav Tvete2009-09-101-2/+8
| | | | Reviewed-by: Jeremy Katz
* Fix for tst_QThread::adoptedThreadAffinity() failure on WindowsPrasanth Ullattil2009-09-091-9/+12
| | | | | | | | beginthread() is not reliable when the new thread exits fast. So we are changing this to use _beginthreadex() instead. Reviewed-by: Trond Reviewed-by: Bradley T. Hughes
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
| * 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
* | Merge commit 'qt/master'Jason Barron2009-08-131-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/samplebuffers/glwidget.cpp src/corelib/io/qfsfileengine_unix.cpp src/corelib/kernel/qobject.cpp src/corelib/tools/qsharedpointer.cpp src/gui/gui.pro tests/auto/qhttp/tst_qhttp.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp
| * | Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| |/ | | | | | | Reviewed-by: Trust Me
* | Merge commit 'qt/master-stable' into 4.6-mergedJason Barron2009-06-301-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .gitignore configure.exe src/corelib/concurrent/qtconcurrentthreadengine.h src/corelib/global/qnamespace.h src/gui/graphicsview/qgraphicssceneevent.h src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication.h src/gui/kernel/qapplication_p.h src/gui/kernel/qapplication_qws.cpp src/gui/kernel/qwidget.h src/gui/painting/qpaintengine_raster.cpp src/gui/text/qfontdatabase.cpp src/network/access/qnetworkaccesshttpbackend.cpp tests/auto/network-settings.h tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro tests/auto/qvariant/tst_qvariant.cpp
| * Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
| | | | | | | | Reviewed-by: Trust Me
* | Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qtaxis2009-04-271-5/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Configure.exe recompiled with MSVC6. Conflicts: configure.exe examples/network/network.pro src/gui/dialogs/qfiledialog_p.h src/gui/dialogs/qfilesystemmodel_p.h src/gui/kernel/qapplication.cpp tests/auto/_Categories/qmake.txt tests/auto/qfile/test/test.pro tests/auto/qfile/tst_qfile.cpp tests/auto/qlibrary/tst_qlibrary.cpp tests/auto/qline/tst_qline.cpp tests/auto/qstyle/tst_qstyle.cpp tests/auto/qtextstream/tst_qtextstream.cpp tests/auto/qtranslator/qtranslator.pro tests/auto/qwaitcondition/tst_qwaitcondition.cpp translations/qt_ja_JP.ts
| * Remove obsolete code from autotests.Jason McDonald2009-04-161-5/+0
| | | | | | | | | | | | | | | | Each version of Qt has its own set of autotests, therefore preprocessor directives relating to obsolete QT_VERSION's are not necessary. Reviewed-by: Carlos Duclos
| * Long live Qt 4.5!Lars Knoll2009-03-231-0/+906
|
* Long live Qt for S60!axis2009-04-241-0/+906