diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2012-04-11 11:06:06 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2012-04-11 11:06:06 -0400 |
commit | 4743a2dac6af23a602c7ce8c5b5b0d351ae340e7 (patch) | |
tree | 8290203934beeb1ea5e37945a4749cf0e7eaca27 /indra/llcommon/llthreadsafequeue.h | |
parent | 4574a9a008690c64158abd6d792d6d485bf0e235 (diff) | |
parent | 46a7cdd2866c4219bb690974d9d6266e6994b431 (diff) |
Automated merge with file:///home/nat/linden/viewer-leap-temp
Diffstat (limited to 'indra/llcommon/llthreadsafequeue.h')
-rw-r--r-- | indra/llcommon/llthreadsafequeue.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/indra/llcommon/llthreadsafequeue.h b/indra/llcommon/llthreadsafequeue.h index 43d0b396f2..58cac38769 100644 --- a/indra/llcommon/llthreadsafequeue.h +++ b/indra/llcommon/llthreadsafequeue.h @@ -30,9 +30,9 @@ #include <string> #include <stdexcept> -#include "llaprpool.h" +struct apr_pool_t; // From apr_pools.h class LLThreadSafeQueueImplementation; // See below. @@ -75,7 +75,7 @@ struct apr_queue_t; // From apr_queue.h class LL_COMMON_API LLThreadSafeQueueImplementation { public: - LLThreadSafeQueueImplementation(unsigned int capacity); + LLThreadSafeQueueImplementation(apr_pool_t * pool, unsigned int capacity); ~LLThreadSafeQueueImplementation(); void pushFront(void * element); bool tryPushFront(void * element); @@ -84,7 +84,8 @@ public: size_t size(); private: - LLAPRPool mPool; // The pool used for mQueue. + bool mOwnsPool; + apr_pool_t * mPool; apr_queue_t * mQueue; }; @@ -98,8 +99,9 @@ class LLThreadSafeQueue public: typedef ElementT value_type; - // Constructor. - LLThreadSafeQueue(unsigned int capacity = 1024); + // If the pool is set to NULL one will be allocated and managed by this + // queue. + LLThreadSafeQueue(apr_pool_t * pool = 0, unsigned int capacity = 1024); // Add an element to the front of queue (will block if the queue has // reached capacity). @@ -137,8 +139,8 @@ private: template<typename ElementT> -LLThreadSafeQueue<ElementT>::LLThreadSafeQueue(unsigned int capacity) : - mImplementation(capacity) +LLThreadSafeQueue<ElementT>::LLThreadSafeQueue(apr_pool_t * pool, unsigned int capacity): + mImplementation(pool, capacity) { ; // No op. } |