From 03cb903e7e3a35350ba09af052eac7844ae070e9 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 16 Jan 2012 01:41:26 +0100 Subject: [PATCH] isolates: remove references to uv_thread_self() uv_thread_self() is difficult to implement on Windows in a way where the return value is valid across threads. It's already been removed from upstream libuv. --- src/node.cc | 5 +---- src/node_isolate.cc | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/node.cc b/src/node.cc index ab24990029..708031740b 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2679,13 +2679,10 @@ int Start(int argc, char *argv[]) { v8::V8::Initialize(); v8::HandleScope handle_scope; - // Get the id of the this, the main, thread. - uv_thread_t tid = uv_thread_self(); - // Create the main node::Isolate object node::Isolate::Initialize(); Isolate* isolate = new node::Isolate(); - isolate->tid_ = tid; + isolate->tid_ = (uv_thread_t) -1; isolate->Enter(); StartThread(isolate, argc, argv); isolate->Dispose(); diff --git a/src/node_isolate.cc b/src/node_isolate.cc index 8f57a0b3b7..52cf0903a5 100644 --- a/src/node_isolate.cc +++ b/src/node_isolate.cc @@ -219,7 +219,6 @@ void Isolate::OnMessage(IsolateMessage* msg, void* arg) { HandleScope scope; Isolate* self = static_cast(arg); - assert(uv_thread_self() == self->tid_); NODE_ISOLATE_CHECK(self); Buffer* buf = Buffer::New(msg->data_, msg->size_, IsolateMessage::Free, msg); @@ -426,7 +425,6 @@ private: } void OnMessage(IsolateMessage* msg) { - assert(uv_thread_self() != isolate_->tid_); NODE_ISOLATE_CHECK(parent_isolate_); HandleScope scope; Buffer* buf = Buffer::New(