aboutsummaryrefslogtreecommitdiff
path: root/src/synchroqueue.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/synchroqueue.h (renamed from src/itoqueue.h)20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/itoqueue.h b/src/synchroqueue.h
index dc3cadb..79d5e49 100644
--- a/src/itoqueue.h
+++ b/src/synchroqueue.h
@@ -5,19 +5,19 @@
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
6 */ 6 */
7 7
8#ifndef BU_ITO_QUEUE_H 8#ifndef BU_SYNCHRO_QUEUE_H
9#define BU_ITO_QUEUE_H 9#define BU_SYNCHRO_QUEUE_H
10 10
11#include <pthread.h> 11#include <pthread.h>
12 12
13#include "itomutex.h" 13#include "bu/mutex.h"
14#include "itocondition.h" 14#include "bu/condition.h"
15 15
16namespace Bu 16namespace Bu
17{ 17{
18 /** 18 /**
19 * A thread-safe queue class. This class is a very simple queue with some 19 * A thread-safe queue class. This class is a very simple queue with some
20 * cool extra functionality for use with the Ito system. The main extra 20 * cool extra functionality for use with the Synchro system. The main extra
21 * that it provides is the option to either dequeue without blocking, with 21 * that it provides is the option to either dequeue without blocking, with
22 * infinite blocking, or with timed blocking, which will return a value if 22 * infinite blocking, or with timed blocking, which will return a value if
23 * something is enqueued within the specified time limit, or NULL if the 23 * something is enqueued within the specified time limit, or NULL if the
@@ -25,7 +25,7 @@ namespace Bu
25 *@ingroup Threading Containers 25 *@ingroup Threading Containers
26 */ 26 */
27 template <class T> 27 template <class T>
28 class ItoQueue 28 class SynchroQueue
29 { 29 {
30 private: 30 private:
31 /** 31 /**
@@ -41,7 +41,7 @@ namespace Bu
41 /** 41 /**
42 * Construct an empty queue. 42 * Construct an empty queue.
43 */ 43 */
44 ItoQueue() : 44 SynchroQueue() :
45 pStart( NULL ), 45 pStart( NULL ),
46 pEnd( NULL ), 46 pEnd( NULL ),
47 nSize( 0 ) 47 nSize( 0 )
@@ -54,7 +54,7 @@ namespace Bu
54 * pointers without cleaning up the memory they pointed to. Make sure 54 * pointers without cleaning up the memory they pointed to. Make sure
55 * you're queue is empty before allowing it to be destroyed! 55 * you're queue is empty before allowing it to be destroyed!
56 */ 56 */
57 ~ItoQueue() 57 ~SynchroQueue()
58 { 58 {
59 Item *pCur = pStart; 59 Item *pCur = pStart;
60 while( pCur ) 60 while( pCur )
@@ -232,8 +232,8 @@ namespace Bu
232 Item *pEnd; /**< The end of the queue, the last element to dequeue. */ 232 Item *pEnd; /**< The end of the queue, the last element to dequeue. */
233 long nSize; /**< The number of items in the queue. */ 233 long nSize; /**< The number of items in the queue. */
234 234
235 ItoMutex mOperate; /**< The master mutex, used on all operations. */ 235 Mutex mOperate; /**< The master mutex, used on all operations. */
236 ItoCondition cBlock; /**< The condition for blocking dequeues. */ 236 Condition cBlock; /**< The condition for blocking dequeues. */
237 }; 237 };
238} 238}
239 239