diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/queue.h | 10 |
1 files changed, 3 insertions, 7 deletions
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<T>::_pop() template<typename T> T *Queue<T>::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<T>::plength() template<typename T> void Queue<T>::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<T>::lock() template<typename T> void Queue<T>::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 |