aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/top.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/top.cc')
-rw-r--r--deps/v8/src/top.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/deps/v8/src/top.cc b/deps/v8/src/top.cc
index 039c29268f..aa7788e3b2 100644
--- a/deps/v8/src/top.cc
+++ b/deps/v8/src/top.cc
@@ -98,7 +98,8 @@ void Top::InitializeThreadLocal() {
thread_local_.stack_is_cooked_ = false;
thread_local_.try_catch_handler_ = NULL;
thread_local_.context_ = NULL;
- thread_local_.thread_id_ = ThreadManager::kInvalidId;
+ int id = ThreadManager::CurrentId();
+ thread_local_.thread_id_ = (id == 0) ? ThreadManager::kInvalidId : id;
thread_local_.external_caught_exception_ = false;
thread_local_.failed_access_check_callback_ = NULL;
clear_pending_exception();