diff options
author | Paul ProductEngine <pguslisty@productengine.com> | 2011-09-07 18:46:51 +0300 |
---|---|---|
committer | Paul ProductEngine <pguslisty@productengine.com> | 2011-09-07 18:46:51 +0300 |
commit | 955bcbb95106e9c0c5d8b75c42c32dde52cc0bb6 (patch) | |
tree | 663ad1c3e33c002ee7ea1bfa5c86d2b713839aba /indra/llcommon/llthreadsafequeue.cpp | |
parent | bb085a45db845a9bfe8aae83ecc7938f618e9ddc (diff) | |
parent | 08c0de785f29801c57feebce8fae593f86113777 (diff) |
Merge mesh-development with sh-2309
Diffstat (limited to 'indra/llcommon/llthreadsafequeue.cpp')
-rw-r--r-- | indra/llcommon/llthreadsafequeue.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/indra/llcommon/llthreadsafequeue.cpp b/indra/llcommon/llthreadsafequeue.cpp index 8a73e632a9..05d24944f3 100644 --- a/indra/llcommon/llthreadsafequeue.cpp +++ b/indra/llcommon/llthreadsafequeue.cpp @@ -34,19 +34,11 @@ //----------------------------------------------------------------------------- -LLThreadSafeQueueImplementation::LLThreadSafeQueueImplementation(apr_pool_t * pool, unsigned int capacity): - mOwnsPool(pool == 0), - mPool(pool), +LLThreadSafeQueueImplementation::LLThreadSafeQueueImplementation(unsigned int capacity): mQueue(0) { - if(mOwnsPool) { - apr_status_t status = apr_pool_create(&mPool, 0); - if(status != APR_SUCCESS) throw LLThreadSafeQueueError("failed to allocate pool"); - } else { - ; // No op. - } - - apr_status_t status = apr_queue_create(&mQueue, capacity, mPool); + mPool.create(); + apr_status_t status = apr_queue_create(&mQueue, capacity, mPool()); if(status != APR_SUCCESS) throw LLThreadSafeQueueError("failed to allocate queue"); } @@ -59,7 +51,6 @@ LLThreadSafeQueueImplementation::~LLThreadSafeQueueImplementation() " elements;" << "memory will be leaked" << LL_ENDL; apr_queue_term(mQueue); } - if(mOwnsPool && (mPool != 0)) apr_pool_destroy(mPool); } |