Comment #2 on issue 708 by [email protected]: GetCurrentThreadId() returns incorrect id in main thread after creation and termination of another thread.
http://code.google.com/p/v8/issues/detail?id=708

The following trivial patch seems to fix this problem in at least some cases. I'm not familiar with the v8 source and haven't checked for any adverse consequences of the patch.


Index: src/api.cc
===================================================================
--- src/api.cc  (revision 5592)
+++ src/api.cc  (working copy)
@@ -4015,7 +4015,7 @@
 int V8::GetCurrentThreadId() {
   API_ENTRY_CHECK("V8::GetCurrentThreadId()");
   EnsureInitialized("V8::GetCurrentThreadId()");
-  return i::Top::thread_id();
+  return i::ThreadManager::CurrentId();
 }


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to