summaryrefslogtreecommitdiff
path: root/libc/malloc_hooks/tests/malloc_hooks_tests.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2015-03-17 14:22:09 -0700
committerYabin Cui <yabinc@google.com>2015-04-08 13:11:13 -0700
commit76615dae93c18ac890e167c547a08c0228709a33 (patch)
tree12a7e87c6fb332bebc087f43bcf29b2f7827571e /libc/malloc_hooks/tests/malloc_hooks_tests.cpp
parent4bd8f9637daaada333ff35945b00cfe6cb822376 (diff)
Provide writer preference option in rwlock.
Previous implementation of rwlock contains four atomic variables, which is hard to maintain and change. So I make following changes in this CL: 1. Add pending flags in rwlock.state, so we don't need to synchronize between different atomic variables. Using compare_and_swap operations on rwlock.state is enough for all state change. 2. Add pending_lock to protect readers/writers waiting and wake up operations. As waiting/wakeup is not performance critical, using a lock is easier to maintain. 3. Add writer preference option. 4. Add unit tests for rwlock. Bug: 19109156 Change-Id: Idcaa58d695ea401d64445610b465ac5cff23ec7c
Diffstat (limited to 'libc/malloc_hooks/tests/malloc_hooks_tests.cpp')
0 files changed, 0 insertions, 0 deletions