Browse Source

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.
v0.7.4-release
Ben Noordhuis 13 years ago
parent
commit
03cb903e7e
  1. 5
      src/node.cc
  2. 2
      src/node_isolate.cc

5
src/node.cc

@ -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();

2
src/node_isolate.cc

@ -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);
@ -426,7 +425,6 @@ private:
} }
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(

Loading…
Cancel
Save