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

Side by Side Diff: src/futex-emulation.cc

Issue 1462833002: Support offset-TypedArray in futex API (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/runtime/runtime-futex.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/futex-emulation.h" 5 #include "src/futex-emulation.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/macros.h" 9 #include "src/base/macros.h"
10 #include "src/base/platform/time.h" 10 #include "src/base/platform/time.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 Handle<JSArrayBuffer> array_buffer, 255 Handle<JSArrayBuffer> array_buffer,
256 size_t addr) { 256 size_t addr) {
257 DCHECK(addr < NumberToSize(isolate, array_buffer->byte_length())); 257 DCHECK(addr < NumberToSize(isolate, array_buffer->byte_length()));
258 void* backing_store = array_buffer->backing_store(); 258 void* backing_store = array_buffer->backing_store();
259 259
260 base::LockGuard<base::Mutex> lock_guard(mutex_.Pointer()); 260 base::LockGuard<base::Mutex> lock_guard(mutex_.Pointer());
261 261
262 int waiters = 0; 262 int waiters = 0;
263 FutexWaitListNode* node = wait_list_.Pointer()->head_; 263 FutexWaitListNode* node = wait_list_.Pointer()->head_;
264 while (node) { 264 while (node) {
265 if (backing_store == node->backing_store_ && addr == node->wait_addr_) { 265 if (backing_store == node->backing_store_ && addr == node->wait_addr_ &&
266 node->waiting_) {
266 waiters++; 267 waiters++;
267 } 268 }
268 269
269 node = node->next_; 270 node = node->next_;
270 } 271 }
271 272
272 return Smi::FromInt(waiters); 273 return Smi::FromInt(waiters);
273 } 274 }
274 275
275 } // namespace internal 276 } // namespace internal
276 } // namespace v8 277 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/runtime/runtime-futex.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698