Home
last modified time | relevance | path

Searched hist:b6b3ccfd (Results 1 – 1 of 1) sorted by relevance

/qemu/qom/
H A Dobject.cb6b3ccfd Fri Sep 30 21:30:57 GMT 2016 Alex Bennée <alex.bennee@linaro.org> 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>