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

Unified Diff: src/v8threads.cc

Issue 242123: Ensure V8 is initialized before locking and unlocking threads. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8threads.cc
===================================================================
--- src/v8threads.cc (revision 3007)
+++ src/v8threads.cc (working copy)
@@ -56,6 +56,12 @@
if (!internal::ThreadManager::IsLockedByCurrentThread()) {
internal::ThreadManager::Lock();
has_lock_ = true;
+ // Make sure that V8 is initialized. Archiving of threads interferes
+ // with deserialization by adding additional root pointers, so we must
+ // initialize here, before anyone can call ~Locker() or Unlocker().
+ if (!internal::V8::IsRunning()) {
+ V8::Initialize();
+ }
// This may be a locker within an unlocker in which case we have to
// get the saved state for this thread and restore it.
if (internal::ThreadManager::RestoreThread()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698