Permalink
Browse files

rmv DETACHED_STATE attribute

  • Loading branch information...
1 parent 210884d commit 0a8be1ae636376d5884d685b57822868f4600f16 @xk committed Jan 30, 2013
Showing with 2 additions and 7 deletions.
  1. +2 −7 src/threads_a_gogo.cc
View
@@ -727,13 +727,8 @@ static Handle<Value> Create (const Arguments &args) {
pthread_mutex_init(&thread->IDLE_mutex, NULL);
pthread_mutex_init(&thread->inQueue.queueLock, NULL);
pthread_mutex_init(&thread->outQueue.queueLock, NULL);
- pthread_attr_t attr;
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- int err= pthread_create(&thread->thread, &attr, aThread, thread);
- pthread_attr_destroy(&attr);
- if (err) {
- //Ha habido un error no se ha arrancado esta thread
+ if (pthread_create(&thread->thread, NULL, aThread, thread)) {
+ //Ha habido un error no se ha arrancado este hilo
destroyaThread(thread);
return ThrowException(Exception::TypeError(String::New("create(): error in pthread_create()")));
}

0 comments on commit 0a8be1a

Please sign in to comment.