diff options
| author | Alex Bennée | 2016-09-30 23:30:57 +0200 |
|---|---|---|
| committer | Paolo Bonzini | 2016-10-04 10:00:26 +0200 |
| commit | b6b3ccfda015dcd5ab50f70c189ee5cc6c622e91 (patch) | |
| tree | ddd09714020bda3ea47d837ca64fbc0d23f04265 /util | |
| parent | seqlock: use atomic writes for the sequence (diff) | |
| download | qemu-b6b3ccfda015dcd5ab50f70c189ee5cc6c622e91.tar.gz qemu-b6b3ccfda015dcd5ab50f70c189ee5cc6c622e91.tar.xz qemu-b6b3ccfda015dcd5ab50f70c189ee5cc6c622e91.zip | |
qom/object: update class cache atomically
The idiom CPU_GET_CLASS(cpu) is fairly extensively used in various
threads and trips of ThreadSanitizer due to the fact it updates
obj->class->object_cast_cache behind the scenes. As this is just a
fast-path cache there is no need to lock updates.
However to ensure defined C11 behaviour across threads we need to use
the plain atomic_read/set primitives and keep the sanitizer happy.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20160930213106.20186-7-alex.bennee@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'util')
0 files changed, 0 insertions, 0 deletions
