Go to file
Thiago Macieira a8c74ddcf7 Fix race condition in QDateTime::timeZone() and other methods
When timezone support for QDateTime was added, we decided it was a good
idea to delay creating the QTimeZone object and checking that the time
is valid in that timezone (including for local time) until the user
requested that information. Unfortunately, QExplicitlySharedDataPointer
returns a non-const T* in operator->(), which meant we were accidentally
modifying the d pointer's contents in const methods, which in turn means
those const methods were not thread-safe when operating on the same
object.

This commit changes the d pointer to QSharedDataPointer, which is safer
in this regard and pointed out where the issues with constness were
located. Since we can't lazily calculate QTimeZone anymore, we need to
do it whenever the date, time or offset changes.

Task-number: QTBUG-43703
Change-Id: Ic5d393bfd36e48a193fcffff13b9686ef4ef1454
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-07 19:22:21 +00:00
bin Fixed license headers 2015-02-17 18:46:09 +00:00
config.tests eglfs: Pluginize RPi, iMX6 and Mali backends 2015-03-05 09:51:16 +00:00
dist Replace old qt-project.org wiki with wiki.qt.io 2015-02-27 09:27:13 +00:00
doc Merge remote-tracking branch 'origin/5.4' into 5.5 2015-03-04 13:44:29 +01:00
examples Polish the Dir View example. 2015-03-06 18:09:42 +00:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs iOS: Enable runnnig Qt tests using 'make check' via xcodebuild test 2015-03-07 11:38:14 +00:00
qmake centralize setup of shell-related variables in spec_post.prf 2015-03-06 19:08:40 +00:00
src Fix race condition in QDateTime::timeZone() and other methods 2015-03-07 19:22:21 +00:00
tests Fix race condition in QDateTime::timeZone() and other methods 2015-03-07 19:22:21 +00:00
tools adjust configure's path output to relative paths 2015-03-06 19:08:37 +00:00
util Fixed license headers 2015-02-17 18:46:09 +00:00
.gitattributes Update the git-archive export options 2012-09-07 15:39:31 +02:00
.gitignore Remove qtdemo from gitignore 2014-09-17 12:38:55 +02:00
.qmake.conf Enable -Werror for all of qtbase 2013-09-04 01:50:10 +02:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
configure eglfs: Pluginize RPi, iMX6 and Mali backends 2015-03-05 09:51:16 +00:00
configure.bat support spaces in build and install dirs 2015-02-17 18:28:00 +00:00
header.BSD Updated BSD licensed file headers 2015-02-15 07:41:17 +00:00
header.FDL Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL3 Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL3-COMM Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL21 Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL-ONLY Update copyright headers 2015-02-11 06:49:51 +00:00
INSTALL Doc: Update links in INSTALL file 2015-02-16 09:06:41 +00:00
LGPL_EXCEPTION.txt Update copyright headers 2015-02-11 06:49:51 +00:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.LGPLv3 Update copyright headers 2015-02-11 06:49:51 +00:00
LICENSE.LGPLv21 Update copyright headers 2015-02-11 06:49:51 +00:00
LICENSE.PREVIEW.COMMERCIAL Update copyright headers 2015-02-11 06:49:51 +00:00
qtbase.pro remove nonsensical claim about contains() 2014-11-13 14:33:16 +01:00
sync.profile ANGLE: upgrade to 2.1~07d49ef5350a 2014-08-05 16:43:22 +02:00