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

Side by Side Diff: src/v8threads.cc

Issue 6577036: [Isolates] Merge from bleeding_edge to isolates, revisions 6100-6300. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/v8natives.js ('k') | src/v8utils.h » ('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 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 state != NULL; 383 state != NULL;
384 state = state->Next()) { 384 state = state->Next()) {
385 if (thread_id == state->id()) { 385 if (thread_id == state->id()) {
386 state->set_terminate_on_restore(true); 386 state->set_terminate_on_restore(true);
387 } 387 }
388 } 388 }
389 } 389 }
390 390
391 391
392 ContextSwitcher::ContextSwitcher(Isolate* isolate, int every_n_ms) 392 ContextSwitcher::ContextSwitcher(Isolate* isolate, int every_n_ms)
393 : Thread(isolate), 393 : Thread(isolate, "v8:CtxtSwitcher"),
394 keep_going_(true), 394 keep_going_(true),
395 sleep_ms_(every_n_ms) { 395 sleep_ms_(every_n_ms) {
396 } 396 }
397 397
398 398
399 // Set the scheduling interval of V8 threads. This function starts the 399 // Set the scheduling interval of V8 threads. This function starts the
400 // ContextSwitcher thread if needed. 400 // ContextSwitcher thread if needed.
401 void ContextSwitcher::StartPreemption(int every_n_ms) { 401 void ContextSwitcher::StartPreemption(int every_n_ms) {
402 Isolate* isolate = Isolate::Current(); 402 Isolate* isolate = Isolate::Current();
403 ASSERT(Locker::IsLocked()); 403 ASSERT(Locker::IsLocked());
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 // Acknowledge the preemption by the receiving thread. 444 // Acknowledge the preemption by the receiving thread.
445 void ContextSwitcher::PreemptionReceived() { 445 void ContextSwitcher::PreemptionReceived() {
446 ASSERT(Locker::IsLocked()); 446 ASSERT(Locker::IsLocked());
447 // There is currently no accounting being done for this. But could be in the 447 // There is currently no accounting being done for this. But could be in the
448 // future, which is why we leave this in. 448 // future, which is why we leave this in.
449 } 449 }
450 450
451 451
452 } // namespace internal 452 } // namespace internal
453 } // namespace v8 453 } // namespace v8
OLDNEW
« no previous file with comments | « src/v8natives.js ('k') | src/v8utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698