diff options
Diffstat (limited to 'runtime/thread.h')
-rw-r--r-- | runtime/thread.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/runtime/thread.h b/runtime/thread.h index f2c22d17a9..97053decc0 100644 --- a/runtime/thread.h +++ b/runtime/thread.h @@ -226,7 +226,13 @@ class Thread { (state_and_flags.as_struct.flags & kSuspendRequest) != 0; } - bool ModifySuspendCount(Thread* self, int delta, AtomicInteger* suspend_barrier, bool for_debugger) + // If delta > 0 and (this != self or suspend_barrier is not null), this function may temporarily + // release thread_suspend_count_lock_ internally. + ALWAYS_INLINE + bool ModifySuspendCount(Thread* self, + int delta, + AtomicInteger* suspend_barrier, + bool for_debugger) REQUIRES(Locks::thread_suspend_count_lock_); bool RequestCheckpoint(Closure* function) @@ -1220,6 +1226,12 @@ class Thread { is_sensitive_thread_hook_ = is_sensitive_thread_hook; } + bool ModifySuspendCountInternal(Thread* self, + int delta, + AtomicInteger* suspend_barrier, + bool for_debugger) + REQUIRES(Locks::thread_suspend_count_lock_); + // 32 bits of atomically changed state and flags. Keeping as 32 bits allows and atomic CAS to // change from being Suspended to Runnable without a suspend request occurring. union PACKED(4) StateAndFlags { |