From 85a7c66cd356a1aac6a9234863382189964d2573 Mon Sep 17 00:00:00 2001 From: deva Date: Sat, 30 Apr 2005 20:58:51 +0000 Subject: Fxed queue mutex deadlock. --- src/queue.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/queue.h') diff --git a/src/queue.h b/src/queue.h index 1f8a80f..1437af4 100644 --- a/src/queue.h +++ b/src/queue.h @@ -187,17 +187,17 @@ T *Queue::_pop() template T *Queue::peek() { - pthread_mutex_lock(&mutex); + // pthread_mutex_lock(&mutex); T *d; - assert(count >= 0); + // assert(count >= 0); if(count == 0) { return NULL; } d = (T*)head->data; - pthread_mutex_unlock(&mutex); + // pthread_mutex_unlock(&mutex); return d; } @@ -219,11 +219,9 @@ void Queue::plength() template void Queue::lock() { - pthread_mutex_lock(&mutex); fprintf(stderr, "Lock this motherfucker..."); fflush(stderr); locked = true; fprintf(stderr, "done\n"); fflush(stderr); - pthread_mutex_unlock(&mutex); } /** @@ -232,11 +230,9 @@ void Queue::lock() template void Queue::unlock() { - pthread_mutex_lock(&mutex); fprintf(stderr, "Unlock this motherfucker..."); fflush(stderr); locked = false; fprintf(stderr, "done\n"); fflush(stderr); - pthread_mutex_unlock(&mutex); } #endif -- cgit v1.2.3