diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/queue.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/queue.h b/src/queue.h index 6b143fd..1f8a80f 100644 --- a/src/queue.h +++ b/src/queue.h @@ -219,9 +219,11 @@ 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); } /** @@ -230,9 +232,11 @@ 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 |