diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-08-08 10:04:19 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-02-12 09:58:24 +0000 |
commit | 983fc2aa4a8a0698422f44461abb14f6dd46df8d (patch) | |
tree | 6962b6c4e78d98d4062e21d320d1b4104a6d5fe2 /src/corelib | |
parent | 08ab00e749c34ec9eae586f9739e0a5d62fc96a9 (diff) |
QFileInfoGatherer: fix race condition on fetchedRoot
Though only present in QT_BUILD_INTERNAL builds, accessing an unprotected
global bool is still a data race.
While the intended use of reset flag/start test/check flag is kosher
when it comes to the happens-before relation, this is no longer true when
users use two instances of QFileSystemModel at the same time.
To fix, make the bool an atomic int instead. Relaxed memory ordering
suffices, since the atomic int represents all the data. The races over
which model sets the variable is the job of the test case to resolve,
and doesn't affect other users.
Change-Id: I4d245b93a741e3457c42df6edd5b836a9bdacd83
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
0 files changed, 0 insertions, 0 deletions