summaryrefslogtreecommitdiffstats
path: root/libbacktrace/BacktraceThread.h
diff options
context:
space:
mode:
Diffstat (limited to 'libbacktrace/BacktraceThread.h')
-rw-r--r--libbacktrace/BacktraceThread.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/libbacktrace/BacktraceThread.h b/libbacktrace/BacktraceThread.h
index ff3e9f3..99a8638 100644
--- a/libbacktrace/BacktraceThread.h
+++ b/libbacktrace/BacktraceThread.h
@@ -48,8 +48,10 @@ public:
inline void Lock() {
pthread_mutex_lock(&mutex_);
- // Reset the futex value in case of multiple unwinds of the same thread.
- futex_ = 0;
+
+ // Always reset the wait value since this could be the first or nth
+ // time this entry is locked.
+ wait_value_ = 0;
}
inline void Unlock() {
@@ -66,9 +68,11 @@ private:
pid_t pid_;
pid_t tid_;
- int futex_;
int ref_count_;
pthread_mutex_t mutex_;
+ pthread_mutex_t wait_mutex_;
+ pthread_cond_t wait_cond_;
+ int wait_value_;
ThreadEntry* next_;
ThreadEntry* prev_;
ucontext_t ucontext_;