Chromium Code Reviews| Index: src/futex-emulation.h |
| diff --git a/src/futex-emulation.h b/src/futex-emulation.h |
| index 86b5f78811b0a32a541e7e76f16daae7642e9e0d..67925acf0509a9befffcb722a9984ed5689ea8d7 100644 |
| --- a/src/futex-emulation.h |
| +++ b/src/futex-emulation.h |
| @@ -8,6 +8,7 @@ |
| #include <stdint.h> |
| #include "src/allocation.h" |
| +#include "src/base/atomicops.h" |
| #include "src/base/lazy-instance.h" |
| #include "src/base/macros.h" |
| #include "src/base/platform/condition-variable.h" |
| @@ -40,7 +41,16 @@ class FutexWaitListNode { |
| next_(nullptr), |
| backing_store_(nullptr), |
| wait_addr_(0), |
| - waiting_(false) {} |
| + waiting_(false), |
|
Jarin
2015/08/19 05:26:05
waiting_(0)
binji
2015/08/19 17:36:23
Done.
|
| + interrupted_(false) {} |
| + |
| + bool waiting() { return base::NoBarrier_Load(&waiting_) != 0; } |
| + |
| + void set_waiting(bool value) { |
| + base::NoBarrier_Store(&waiting_, value ? 1 : 0); |
| + } |
| + |
| + void NotifyWake(); |
| private: |
| friend class FutexEmulation; |
| @@ -51,7 +61,8 @@ class FutexWaitListNode { |
| FutexWaitListNode* next_; |
| void* backing_store_; |
| size_t wait_addr_; |
| - bool waiting_; |
| + base::Atomic32 waiting_; |
| + bool interrupted_; |
| DISALLOW_COPY_AND_ASSIGN(FutexWaitListNode); |
| }; |
| @@ -115,6 +126,8 @@ class FutexEmulation : public AllStatic { |
| size_t addr); |
| private: |
| + friend class FutexWaitListNode; |
| + |
| static base::LazyMutex mutex_; |
| static base::LazyInstance<FutexWaitList>::type wait_list_; |
| }; |