Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: src/futex-emulation.h

Issue 2659083004: [SAB] Fix crash in Atomics.wake w/ infinite count. (Closed)
Patch Set: fix Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/futex-emulation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/futex-emulation.h
diff --git a/src/futex-emulation.h b/src/futex-emulation.h
index f1f3655dc74f49f26331840e4fffeeb971ee289d..801198fab8aa642414c96e271bfaa3b7a2bec345 100644
--- a/src/futex-emulation.h
+++ b/src/futex-emulation.h
@@ -82,6 +82,9 @@ class FutexWaitList {
class FutexEmulation : public AllStatic {
public:
+ // Pass to Wake() to wake all waiters.
+ static const uint32_t kWakeAll = UINT32_MAX;
+
// Check that array_buffer[addr] == value, and return "not-equal" if not. If
// they are equal, block execution on |isolate|'s thread until woken via
// |Wake|, or when the time given in |rel_timeout_ms| elapses. Note that
@@ -92,10 +95,11 @@ class FutexEmulation : public AllStatic {
size_t addr, int32_t value, double rel_timeout_ms);
// Wake |num_waiters_to_wake| threads that are waiting on the given |addr|.
- // The rest of the waiters will continue to wait. The return value is the
- // number of woken waiters.
+ // |num_waiters_to_wake| can be kWakeAll, in which case all waiters are
+ // woken. The rest of the waiters will continue to wait. The return value is
+ // the number of woken waiters.
static Object* Wake(Isolate* isolate, Handle<JSArrayBuffer> array_buffer,
- size_t addr, int num_waiters_to_wake);
+ size_t addr, uint32_t num_waiters_to_wake);
// Return the number of threads waiting on |addr|. Should only be used for
// testing.
« no previous file with comments | « no previous file | src/futex-emulation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698