Revision: 3008
Author: [email protected]
Date: Fri Oct 2 04:39:56 2009
Log: Ensure V8 is initialized before locking and unlocking threads.
Review URL: http://codereview.chromium.org/242123
http://code.google.com/p/v8/source/detail?r=3008
Modified:
/branches/bleeding_edge/src/v8threads.cc
=======================================
--- /branches/bleeding_edge/src/v8threads.cc Thu Oct 1 03:33:05 2009
+++ /branches/bleeding_edge/src/v8threads.cc Fri Oct 2 04:39:56 2009
@@ -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()) {
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---