| Index: src/futex-emulation.h
|
| diff --git a/src/futex-emulation.h b/src/futex-emulation.h
|
| index 2a07f332d56fc472d3c7fef2028573780ba3bef9..7d93df57b755f24322999f283ceca3da431e1103 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"
|
| @@ -39,7 +40,25 @@ class FutexWaitListNode {
|
| next_(nullptr),
|
| backing_store_(nullptr),
|
| wait_addr_(0),
|
| - waiting_(false) {}
|
| + waiting_(false),
|
| + interrupted_(false) {}
|
| +
|
| + bool waiting() { return base::NoBarrier_Load(&waiting_) != 0; }
|
| + bool interrupted() { return base::NoBarrier_Load(&interrupted_) != 0; }
|
| +
|
| + void set_waiting(bool value) {
|
| + base::NoBarrier_Store(&waiting_, value ? 1 : 0);
|
| + }
|
| +
|
| + void set_interrupted(bool value) {
|
| + base::NoBarrier_Store(&interrupted_, value ? 1 : 0);
|
| + }
|
| +
|
| + bool CheckInterruptedAndClear() {
|
| + return base::NoBarrier_CompareAndSwap(&interrupted_, 1, 0) == 1;
|
| + }
|
| +
|
| + void NotifyWake();
|
|
|
| private:
|
| friend class FutexEmulation;
|
| @@ -50,7 +69,8 @@ class FutexWaitListNode {
|
| FutexWaitListNode* next_;
|
| void* backing_store_;
|
| size_t wait_addr_;
|
| - bool waiting_;
|
| + base::Atomic32 waiting_;
|
| + base::Atomic32 interrupted_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(FutexWaitListNode);
|
| };
|
| @@ -114,6 +134,8 @@ class FutexEmulation : public AllStatic {
|
| size_t addr);
|
|
|
| private:
|
| + friend class FutexWaitListNode;
|
| +
|
| static base::LazyMutex mutex_;
|
| static base::LazyInstance<FutexWaitList>::type wait_list_;
|
| };
|
|
|