Implement mutex requeueing for cv broadcasts.
Make the mutex guarding a condition variable part of its state. On a
broadcast requeue waiters on the mutex so they are awoken as the mutex
is unlocked (thereby avoiding thundering herds). Explicit futex use
still guarded behind ART_USE_FUTEXES which remains disabled as I'm
unhappy with some of the warts of mutex usage. Uploading so that the API
changes can stabilize.
Change-Id: Iedb601856ccd8bbc3a64da4ba0cee82246e7bcbf
diff --git a/src/signal_catcher.h b/src/signal_catcher.h
index e8ac812..074267e 100644
--- a/src/signal_catcher.h
+++ b/src/signal_catcher.h
@@ -51,8 +51,8 @@
std::string stack_trace_file_;
- mutable Mutex lock_;
- ConditionVariable cond_;
+ mutable Mutex lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
+ ConditionVariable cond_ GUARDED_BY(lock_);
bool halt_ GUARDED_BY(lock_);
pthread_t pthread_ GUARDED_BY(lock_);
Thread* thread_ GUARDED_BY(lock_);