Move to newer clang annotations
Also enable -Wthread-safety-negative.
Changes:
Switch to capabilities and negative capabilities.
Future work:
Use capabilities to implement uninterruptible annotations to work
with AssertNoThreadSuspension.
Bug: 20072211
Change-Id: I42fcbe0300d98a831c89d1eff3ecd5a7e99ebf33
diff --git a/runtime/gc/task_processor.h b/runtime/gc/task_processor.h
index 5f48619..e40fa06 100644
--- a/runtime/gc/task_processor.h
+++ b/runtime/gc/task_processor.h
@@ -54,17 +54,17 @@
public:
TaskProcessor();
virtual ~TaskProcessor();
- void AddTask(Thread* self, HeapTask* task) LOCKS_EXCLUDED(lock_);
- HeapTask* GetTask(Thread* self) LOCKS_EXCLUDED(lock_);
- void Start(Thread* self) LOCKS_EXCLUDED(lock_);
+ void AddTask(Thread* self, HeapTask* task) REQUIRES(!*lock_);
+ HeapTask* GetTask(Thread* self) REQUIRES(!*lock_);
+ void Start(Thread* self) REQUIRES(!*lock_);
// Stop tells the RunAllTasks to finish up the remaining tasks as soon as
// possible then return.
- void Stop(Thread* self) LOCKS_EXCLUDED(lock_);
- void RunAllTasks(Thread* self) LOCKS_EXCLUDED(lock_);
- bool IsRunning() const LOCKS_EXCLUDED(lock_);
+ void Stop(Thread* self) REQUIRES(!*lock_);
+ void RunAllTasks(Thread* self) REQUIRES(!*lock_);
+ bool IsRunning() const REQUIRES(!*lock_);
void UpdateTargetRunTime(Thread* self, HeapTask* target_time, uint64_t new_target_time)
- LOCKS_EXCLUDED(lock_);
- Thread* GetRunningThread() const LOCKS_EXCLUDED(lock_);
+ REQUIRES(!*lock_);
+ Thread* GetRunningThread() const REQUIRES(!*lock_);
private:
class CompareByTargetRunTime {