summaryrefslogtreecommitdiff
path: root/qpid/cpp/common/io/src/LFProcessor.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2006-10-11 15:50:15 +0000
committerAlan Conway <aconway@apache.org>2006-10-11 15:50:15 +0000
commitac3335857e3b30b99240c2a7638c8aed31d3e78d (patch)
tree144465ed3ea20dab341a972377de9c0451b71113 /qpid/cpp/common/io/src/LFProcessor.cpp
parenta3d3d2ccc0ccb5d4b857be93c4774ac1bddd0aeb (diff)
downloadqpid-python-ac3335857e3b30b99240c2a7638c8aed31d3e78d.tar.gz
Turned up gcc warnings, fixed warnings in code, enabled -Werror.
Note: #include "qpid_test_plugin.h" instead of <cppunit/TestPlugin.h> Works around warning from a cppunit macro. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@462834 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/common/io/src/LFProcessor.cpp')
-rw-r--r--qpid/cpp/common/io/src/LFProcessor.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/qpid/cpp/common/io/src/LFProcessor.cpp b/qpid/cpp/common/io/src/LFProcessor.cpp
index 8ef3543b8f..3ac66576e3 100644
--- a/qpid/cpp/common/io/src/LFProcessor.cpp
+++ b/qpid/cpp/common/io/src/LFProcessor.cpp
@@ -25,15 +25,17 @@ using namespace qpid::io;
using namespace qpid::concurrent;
using qpid::QpidError;
-LFProcessor::LFProcessor(apr_pool_t* pool, int _workers, int _size, int _timeout) : size(_size),
- timeout(_timeout),
- signalledCount(0),
- current(0),
- count(0),
- hasLeader(false),
- workerCount(_workers),
- workers(new Thread*[_workers]),
- stopped(false){
+LFProcessor::LFProcessor(apr_pool_t* pool, int _workers, int _size, int _timeout) :
+ size(_size),
+ timeout(_timeout),
+ signalledCount(0),
+ current(0),
+ count(0),
+ workerCount(_workers),
+ hasLeader(false),
+ workers(new Thread*[_workers]),
+ stopped(false)
+{
CHECK_APR_SUCCESS(apr_pollset_create(&pollset, size, pool, APR_POLLSET_THREADSAFE));
//create & start the required number of threads
@@ -87,17 +89,13 @@ void LFProcessor::update(const apr_pollfd_t* const fd){
}
bool LFProcessor::full(){
- countLock.acquire();
- bool full = count == size;
- countLock.release();
- return full;
+ Locker locker(countLock);
+ return count == size;
}
bool LFProcessor::empty(){
- countLock.acquire();
- bool empty = count == 0;
- countLock.release();
- return empty;
+ Locker locker(countLock);
+ return count == 0;
}
void LFProcessor::poll(){