[threading linux] Implement suspend count
Add suspend count to thread implementation. Increment suspend count on suspend and decrement on resume. Wait on suspend count to be decremented to 0. Return suspend count on suspend and on resume before incr/decr. Fix naming of resume suspend count to make clear that suspend count is before incr/decr. Add test.
This commit is contained in:
committed by
Rick Gibbed
parent
382dd8860f
commit
e945a13957
@@ -389,7 +389,7 @@ class Thread : public WaitHandle {
|
||||
|
||||
// Decrements a thread's suspend count. When the suspend count is decremented
|
||||
// to zero, the execution of the thread is resumed.
|
||||
virtual bool Resume(uint32_t* out_new_suspend_count = nullptr) = 0;
|
||||
virtual bool Resume(uint32_t* out_previous_suspend_count = nullptr) = 0;
|
||||
|
||||
// Suspends the specified thread.
|
||||
virtual bool Suspend(uint32_t* out_previous_suspend_count = nullptr) = 0;
|
||||
|
||||
Reference in New Issue
Block a user