Commit 9733617e by Abseil Team Committed by Copybara-Service

Clean up the XRay annotation leftover on mutex.

PiperOrigin-RevId: 497998566
Change-Id: I8d43311e280a5ea46c42abed55be62cd70d4d54a
parent f7affaf3
...@@ -1155,7 +1155,7 @@ void Mutex::TryRemove(PerThreadSynch *s) { ...@@ -1155,7 +1155,7 @@ void Mutex::TryRemove(PerThreadSynch *s) {
// if the wait extends past the absolute time specified, even if "s" is still // if the wait extends past the absolute time specified, even if "s" is still
// on the mutex queue. In this case, remove "s" from the queue and return // on the mutex queue. In this case, remove "s" from the queue and return
// true, otherwise return false. // true, otherwise return false.
ABSL_XRAY_LOG_ARGS(1) void Mutex::Block(PerThreadSynch *s) { void Mutex::Block(PerThreadSynch *s) {
while (s->state.load(std::memory_order_acquire) == PerThreadSynch::kQueued) { while (s->state.load(std::memory_order_acquire) == PerThreadSynch::kQueued) {
if (!DecrementSynchSem(this, s, s->waitp->timeout)) { if (!DecrementSynchSem(this, s, s->waitp->timeout)) {
// After a timeout, we go into a spin loop until we remove ourselves // After a timeout, we go into a spin loop until we remove ourselves
...@@ -1504,7 +1504,7 @@ static bool TryAcquireWithSpinning(std::atomic<intptr_t>* mu) { ...@@ -1504,7 +1504,7 @@ static bool TryAcquireWithSpinning(std::atomic<intptr_t>* mu) {
return false; return false;
} }
ABSL_XRAY_LOG_ARGS(1) void Mutex::Lock() { void Mutex::Lock() {
ABSL_TSAN_MUTEX_PRE_LOCK(this, 0); ABSL_TSAN_MUTEX_PRE_LOCK(this, 0);
GraphId id = DebugOnlyDeadlockCheck(this); GraphId id = DebugOnlyDeadlockCheck(this);
intptr_t v = mu_.load(std::memory_order_relaxed); intptr_t v = mu_.load(std::memory_order_relaxed);
...@@ -1522,7 +1522,7 @@ ABSL_XRAY_LOG_ARGS(1) void Mutex::Lock() { ...@@ -1522,7 +1522,7 @@ ABSL_XRAY_LOG_ARGS(1) void Mutex::Lock() {
ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0); ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0);
} }
ABSL_XRAY_LOG_ARGS(1) void Mutex::ReaderLock() { void Mutex::ReaderLock() {
ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_read_lock); ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_read_lock);
GraphId id = DebugOnlyDeadlockCheck(this); GraphId id = DebugOnlyDeadlockCheck(this);
intptr_t v = mu_.load(std::memory_order_relaxed); intptr_t v = mu_.load(std::memory_order_relaxed);
...@@ -1635,7 +1635,7 @@ bool Mutex::AwaitCommon(const Condition &cond, KernelTimeout t) { ...@@ -1635,7 +1635,7 @@ bool Mutex::AwaitCommon(const Condition &cond, KernelTimeout t) {
return res; return res;
} }
ABSL_XRAY_LOG_ARGS(1) bool Mutex::TryLock() { bool Mutex::TryLock() {
ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_try_lock); ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_try_lock);
intptr_t v = mu_.load(std::memory_order_relaxed); intptr_t v = mu_.load(std::memory_order_relaxed);
if ((v & (kMuWriter | kMuReader | kMuEvent)) == 0 && // try fast acquire if ((v & (kMuWriter | kMuReader | kMuEvent)) == 0 && // try fast acquire
...@@ -1664,7 +1664,7 @@ ABSL_XRAY_LOG_ARGS(1) bool Mutex::TryLock() { ...@@ -1664,7 +1664,7 @@ ABSL_XRAY_LOG_ARGS(1) bool Mutex::TryLock() {
return false; return false;
} }
ABSL_XRAY_LOG_ARGS(1) bool Mutex::ReaderTryLock() { bool Mutex::ReaderTryLock() {
ABSL_TSAN_MUTEX_PRE_LOCK(this, ABSL_TSAN_MUTEX_PRE_LOCK(this,
__tsan_mutex_read_lock | __tsan_mutex_try_lock); __tsan_mutex_read_lock | __tsan_mutex_try_lock);
intptr_t v = mu_.load(std::memory_order_relaxed); intptr_t v = mu_.load(std::memory_order_relaxed);
...@@ -1710,7 +1710,7 @@ ABSL_XRAY_LOG_ARGS(1) bool Mutex::ReaderTryLock() { ...@@ -1710,7 +1710,7 @@ ABSL_XRAY_LOG_ARGS(1) bool Mutex::ReaderTryLock() {
return false; return false;
} }
ABSL_XRAY_LOG_ARGS(1) void Mutex::Unlock() { void Mutex::Unlock() {
ABSL_TSAN_MUTEX_PRE_UNLOCK(this, 0); ABSL_TSAN_MUTEX_PRE_UNLOCK(this, 0);
DebugOnlyLockLeave(this); DebugOnlyLockLeave(this);
intptr_t v = mu_.load(std::memory_order_relaxed); intptr_t v = mu_.load(std::memory_order_relaxed);
...@@ -1762,7 +1762,7 @@ static bool ExactlyOneReader(intptr_t v) { ...@@ -1762,7 +1762,7 @@ static bool ExactlyOneReader(intptr_t v) {
return (v & kMuMultipleWaitersMask) == 0; return (v & kMuMultipleWaitersMask) == 0;
} }
ABSL_XRAY_LOG_ARGS(1) void Mutex::ReaderUnlock() { void Mutex::ReaderUnlock() {
ABSL_TSAN_MUTEX_PRE_UNLOCK(this, __tsan_mutex_read_lock); ABSL_TSAN_MUTEX_PRE_UNLOCK(this, __tsan_mutex_read_lock);
DebugOnlyLockLeave(this); DebugOnlyLockLeave(this);
intptr_t v = mu_.load(std::memory_order_relaxed); intptr_t v = mu_.load(std::memory_order_relaxed);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment