diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2013-05-17 12:03:46 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2013-05-17 12:03:46 +0000 |
commit | c9af8185153178abc5649196c472d5325d0389ee (patch) | |
tree | fce306cf761a582dea6b9ec08952dd867e73c7b6 /compiler-rt/lib/tsan/rtl/tsan_interface_java.h | |
parent | 69c544d857ad7dbc0521d861bd90c7a124de8b0e (diff) | |
download | bcm5719-llvm-c9af8185153178abc5649196c472d5325d0389ee.tar.gz bcm5719-llvm-c9af8185153178abc5649196c472d5325d0389ee.zip |
tsan: introduce recursive mutex lock/unlock java interface
this is required to handle Object.Wait()
llvm-svn: 182088
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_interface_java.h')
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_interface_java.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interface_java.h b/compiler-rt/lib/tsan/rtl/tsan_interface_java.h index 241483aaa01..9ac78e074bb 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_interface_java.h +++ b/compiler-rt/lib/tsan/rtl/tsan_interface_java.h @@ -55,8 +55,7 @@ void __tsan_java_move(jptr src, jptr dst, jptr size) INTERFACE_ATTRIBUTE; // Mutex lock. // Addr is any unique address associated with the mutex. -// Must not be called on recursive reentry. -// Object.wait() is handled as a pair of unlock/lock. +// Can be called on recursive reentry. void __tsan_java_mutex_lock(jptr addr) INTERFACE_ATTRIBUTE; // Mutex unlock. void __tsan_java_mutex_unlock(jptr addr) INTERFACE_ATTRIBUTE; @@ -64,6 +63,16 @@ void __tsan_java_mutex_unlock(jptr addr) INTERFACE_ATTRIBUTE; void __tsan_java_mutex_read_lock(jptr addr) INTERFACE_ATTRIBUTE; // Mutex read unlock. void __tsan_java_mutex_read_unlock(jptr addr) INTERFACE_ATTRIBUTE; +// Recursive mutex lock, intended for handling of Object.wait(). +// The 'rec' value must be obtained from the previous +// __tsan_java_mutex_unlock_rec(). +void __tsan_java_mutex_lock_rec(jptr addr, int rec) INTERFACE_ATTRIBUTE; +// Recursive mutex unlock, intended for handling of Object.wait(). +// The return value says how many times this thread called lock() +// w/o a pairing unlock() (i.e. how many recursive levels it unlocked). +// It must be passed back to __tsan_java_mutex_lock_rec() to restore +// the same recursion level. +int __tsan_java_mutex_unlock_rec(jptr addr) INTERFACE_ATTRIBUTE; #ifdef __cplusplus } // extern "C" |