]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common: fix rare race condition in Throttle unit tests 944/head
authorLoic Dachary <loic@dachary.org>
Sun, 15 Dec 2013 13:31:27 +0000 (14:31 +0100)
committerLoic Dachary <loic@dachary.org>
Sun, 15 Dec 2013 13:31:27 +0000 (14:31 +0100)
commite57239e92057c9cf3e2798d93662e6c43458883e
treeedbc86ba48917942d6b1d9ce080d6579103fc1d8
parent938f22cae26fdaf7271d4ef424c5ee8472deeb5e
common: fix rare race condition in Throttle unit tests

The thread created to test Throttle race conditions updates a value (
throttle.get_current() ) that is tested by the main gtest thread but is
not protected by a lock. Instead of adding a lock, the main thread tests
the value after pthread_join() on the child thread.

http://tracker.ceph.com/issues/6679 fixes #6679

Signed-off-by: Loic Dachary <loic@dachary.org>
src/test/common/Throttle.cc