summaryrefslogtreecommitdiff
path: root/src/threadsafe_queue.h
diff options
context:
space:
mode:
authordeva <deva>2005-10-08 15:56:24 +0000
committerdeva <deva>2005-10-08 15:56:24 +0000
commitb6a85d646c94f8b1efc51c4a50a644fc902c9521 (patch)
tree8206479fc2eff08586badcd2ca8b1b766717c3a5 /src/threadsafe_queue.h
parent3338a985ce001f4d73aaefa450e008b10496273b (diff)
*** empty log message ***
Diffstat (limited to 'src/threadsafe_queue.h')
-rw-r--r--src/threadsafe_queue.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/threadsafe_queue.h b/src/threadsafe_queue.h
index 616e81e..b6d5725 100644
--- a/src/threadsafe_queue.h
+++ b/src/threadsafe_queue.h
@@ -28,29 +28,31 @@
#ifndef __MIAV_THREADSAFE_QUEUE_H__
#define __MIAV_THREADSAFE_QUEUE_H__
-#include <pthread.h>
-#include <semaphore.h>
+#include "mutex.h"
+#include "semaphore.h"
template <typename T>
class ThreadSafeQueue {
public:
ThreadSafeQueue() {
- pthread_mutex_init (&mutex, NULL);
- sem_init(&semaphore, 0, 0);
+ // pthread_mutex_init (&mutex, NULL);
+ // sem_init(&semaphore, 0, 0);
}
virtual ~ThreadSafeQueue() {
- pthread_mutex_destroy(&mutex);
- sem_destroy(&semaphore);
+ // pthread_mutex_destroy(&mutex);
+ //sem_destroy(&semaphore);
}
virtual void push(T t) = 0;
virtual T pop() = 0;
virtual int size() = 0;
- //protected:
- pthread_mutex_t mutex;
- sem_t semaphore;
+protected:
+ // pthread_mutex_t mutex;
+ Mutex mutex;
+ //sem_t semaphore;
+ Semaphore semaphore;
};
#endif/*__MIAV_THREADSAFE_QUEUE_H__*/