diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2013-09-20 03:07:14 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-26 06:31:32 +0200 |
commit | 935e52108d54f76fbcdc09479125ec5f7a3bb5b2 (patch) | |
tree | cd465021251e5941c7ded64f70494d6b6231c4c2 /.gitattributes | |
parent | c66d42f97299c19fab40a7f59be961e6928f43ed (diff) |
QtConcurrent::IterateKernel: fix a race on a cache variable
getticks() can be called concurrently, so accessing a non-atomic static long,
even when the assignment will produce the same value in evey case, constitutes
a data race.
Fixed by making 'useThreadCpuTime' atomic.
Since atomic long's might not be supported on all platforms, use an
atomic int instead. To avoid a narrowing conversion, and since we're
not interested in the return value of sysconf(), only whether it
succeeded, convert any non-error return value to 0 prior to storing
in the atomic.
Change-Id: Ic285f7801327b30ddcd9c24bf1ccee3112a447b1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to '.gitattributes')
0 files changed, 0 insertions, 0 deletions