Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
isolates: remove references to uv_thread_self()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bnoordhuis committed Jan 16, 2012
1 parent 8a98c2f commit 03cb903
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 1 addition & 4 deletions src/node.cc
Expand Up @@ -2679,13 +2679,10 @@ int Start(int argc, char *argv[]) {
v8::V8::Initialize(); v8::V8::Initialize();
v8::HandleScope handle_scope; 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 // Create the main node::Isolate object
node::Isolate::Initialize(); node::Isolate::Initialize();
Isolate* isolate = new node::Isolate(); Isolate* isolate = new node::Isolate();
isolate->tid_ = tid; isolate->tid_ = (uv_thread_t) -1;
isolate->Enter(); isolate->Enter();
StartThread(isolate, argc, argv); StartThread(isolate, argc, argv);
isolate->Dispose(); isolate->Dispose();
Expand Down
2 changes: 0 additions & 2 deletions src/node_isolate.cc
Expand Up @@ -219,7 +219,6 @@ void Isolate::OnMessage(IsolateMessage* msg, void* arg) {
HandleScope scope; HandleScope scope;


Isolate* self = static_cast<Isolate*>(arg); Isolate* self = static_cast<Isolate*>(arg);
assert(uv_thread_self() == self->tid_);
NODE_ISOLATE_CHECK(self); NODE_ISOLATE_CHECK(self);


Buffer* buf = Buffer::New(msg->data_, msg->size_, IsolateMessage::Free, msg); Buffer* buf = Buffer::New(msg->data_, msg->size_, IsolateMessage::Free, msg);
Expand Down Expand Up @@ -426,7 +425,6 @@ struct IsolateWrap: public ObjectWrap {
} }


void OnMessage(IsolateMessage* msg) { void OnMessage(IsolateMessage* msg) {
assert(uv_thread_self() != isolate_->tid_);
NODE_ISOLATE_CHECK(parent_isolate_); NODE_ISOLATE_CHECK(parent_isolate_);
HandleScope scope; HandleScope scope;
Buffer* buf = Buffer::New( Buffer* buf = Buffer::New(
Expand Down

0 comments on commit 03cb903

Please sign in to comment.