Use static thread safety analysis when available, and fix the bugs GCC finds.
It's impossible to express the Heap locking and the ThreadList locking with
GCC, but Clang is supposed to be able to do it. This patch does what's possible
for now.
Change-Id: Ib64a890c9d27c6ce255d5003cb755c2ef1beba95
diff --git a/src/signal_catcher.h b/src/signal_catcher.h
index 131b07c..35e035f 100644
--- a/src/signal_catcher.h
+++ b/src/signal_catcher.h
@@ -44,14 +44,15 @@
void Output(const std::string& s);
void SetHaltFlag(bool new_value);
bool ShouldHalt();
- int WaitForSignal(SignalSet& signals);
+ int WaitForSignal(Thread* self, SignalSet& signals);
std::string stack_trace_file_;
+
mutable Mutex lock_;
- bool halt_;
ConditionVariable cond_;
- pthread_t pthread_;
- Thread* thread_;
+ bool halt_ GUARDED_BY(lock_);
+ pthread_t pthread_ GUARDED_BY(lock_);
+ Thread* thread_ GUARDED_BY(lock_);
};
} // namespace art