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

Unified Diff: src/v8threads.cc

Issue 25002004: make v8::Locker not use Isolate::GetCurrent() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | « src/isolate.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8threads.cc
diff --git a/src/v8threads.cc b/src/v8threads.cc
index 94a5e8051da9d1a28ab7193cd4f8df7e4e6c69c6..cc4f43965f3528e8272e4ac85beaa5f527f9060f 100644
--- a/src/v8threads.cc
+++ b/src/v8threads.cc
@@ -42,11 +42,6 @@ namespace v8 {
bool Locker::active_ = false;
-Locker::Locker() {
- Initialize(i::Isolate::GetDefaultIsolateForLocking());
-}
-
-
// Once the Locker is initialized, the current thread will be guaranteed to have
// the lock for a given isolate.
void Locker::Initialize(v8::Isolate* isolate) {
@@ -116,11 +111,6 @@ Locker::~Locker() {
}
-Unlocker::Unlocker() {
- Initialize(i::Isolate::GetDefaultIsolateForLocking());
-}
-
-
void Unlocker::Initialize(v8::Isolate* isolate) {
ASSERT(isolate != NULL);
isolate_ = reinterpret_cast<i::Isolate*>(isolate);
@@ -143,14 +133,15 @@ Unlocker::~Unlocker() {
}
-void Locker::StartPreemption(int every_n_ms) {
+void Locker::StartPreemption(v8::Isolate* isolate, int every_n_ms) {
v8::internal::ContextSwitcher::StartPreemption(
- i::Isolate::Current(), every_n_ms);
+ reinterpret_cast<i::Isolate*>(isolate), every_n_ms);
}
-void Locker::StopPreemption() {
- v8::internal::ContextSwitcher::StopPreemption(i::Isolate::Current());
+void Locker::StopPreemption(v8::Isolate* isolate) {
+ v8::internal::ContextSwitcher::StopPreemption(
+ reinterpret_cast<i::Isolate*>(isolate));
}
« no previous file with comments | « src/isolate.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698