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

Unified Diff: include/v8.h

Issue 6788023: Per-isolate v8::Locker and v8::Unlocker (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: New tests for IsLocker Created 9 years, 8 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/api.h » ('j') | src/execution.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index d15d024dc3ce11164f9b28eb026f8fa2c74e93d7..97c0d22d01f5112b6ee2b3febe503348724484bf 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -3394,13 +3394,18 @@ class V8EXPORT Context {
class V8EXPORT Unlocker {
public:
Unlocker();
+ explicit Unlocker(Isolate* isolate);
~Unlocker();
+ private:
+ void Init();
+ internal::Isolate* isolate_;
};
class V8EXPORT Locker {
public:
Locker();
+ explicit Locker(Isolate* isolate);
Dmitry Titov 2011/04/13 00:45:10 Consider: If it was: explicit Locker(Isolate* isol
Dmitry Lomov 2011/04/13 00:54:12 Yes, this sounds reasonable to me On 2011/04/13 00
Dmitry Lomov 2011/04/19 01:50:47 Done.
~Locker();
/**
@@ -3418,18 +3423,27 @@ class V8EXPORT Locker {
static void StopPreemption();
/**
- * Returns whether or not the locker is locked by the current thread.
+ * Returns whether or not the locker for current isolate is locked by
+ * the current thread.
*/
static bool IsLocked();
/**
+ * Returns whether or not the locker for a given isolate is locked by the current thread.
Vitaly Repeshko 2011/04/15 00:29:39 nit: Long line.
Dmitry Lomov 2011/04/19 01:50:47 Done.
+ */
+ static bool IsLocked(Isolate * isolate);
Vitaly Repeshko 2011/04/15 00:29:39 nit: Drop space before '*'.
Dmitry Lomov 2011/04/19 01:50:47 Done.
+
+ /**
* Returns whether v8::Locker is being used by this V8 instance.
*/
static bool IsActive() { return active_; }
private:
+ void Init();
+
bool has_lock_;
bool top_level_;
+ internal::Isolate* isolate_;
static bool active_;
« no previous file with comments | « no previous file | src/api.h » ('j') | src/execution.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698