From aa1b29163f1f7cafb067878b36cc641108f2247e Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 22 Dec 2011 15:39:19 +0100 Subject: [PATCH] changed return value of locks, spelling --- Dispatcher/DispatcherImpl.h | 2 +- Dispatcher/DispatcherQueue.h | 2 +- Dispatcher/DispatcherThread.cpp | 30 ++++++------------------------ Dispatcher/DispatcherThread.h | 2 +- 4 files changed, 9 insertions(+), 27 deletions(-) diff --git a/Dispatcher/DispatcherImpl.h b/Dispatcher/DispatcherImpl.h index b48886b6f6..8edd5859ba 100644 --- a/Dispatcher/DispatcherImpl.h +++ b/Dispatcher/DispatcherImpl.h @@ -29,7 +29,7 @@ #ifndef TRIAGENS_FYN_DISPATCHER_DISPATCHER_IMPL_H #define TRIAGENS_FYN_DISPATCHER_DISPATCHER_IMPL_H 1 -#include +#include #include #include diff --git a/Dispatcher/DispatcherQueue.h b/Dispatcher/DispatcherQueue.h index 7ebd4212f5..16dda01ad2 100644 --- a/Dispatcher/DispatcherQueue.h +++ b/Dispatcher/DispatcherQueue.h @@ -29,7 +29,7 @@ #ifndef TRIAGENS_FYN_DISPATCHER_DISPATCHER_QUEUE_H #define TRIAGENS_FYN_DISPATCHER_DISPATCHER_QUEUE_H 1 -#include +#include #include #include diff --git a/Dispatcher/DispatcherThread.cpp b/Dispatcher/DispatcherThread.cpp index 228c3d2946..6c7c08ee01 100644 --- a/Dispatcher/DispatcherThread.cpp +++ b/Dispatcher/DispatcherThread.cpp @@ -69,10 +69,7 @@ namespace triagens { // ----------------------------------------------------------------------------- void DispatcherThread::run () { - if (! queue->accessQueue.lock()) { - LOGGER_FATAL << "cannot lock in " << __FILE__ << "@" << __LINE__; - exit(EXIT_FAILURE); - } + queue->accessQueue.lock(); queue->nrStarted--; queue->nrRunning++; @@ -115,10 +112,7 @@ namespace triagens { } // now release the queue lock (initialise is inside the lock, work outside) - if (! queue->accessQueue.unlock()) { - LOGGER_FATAL << "cannot unlock in " << __FILE__ << "@" << __LINE__; - exit(EXIT_FAILURE); - } + queue->accessQueue.unlock(); // do the work (this might change the job type) Job::status_e status = Job::JOB_FAILED; @@ -191,10 +185,7 @@ namespace triagens { status = Job::JOB_FAILED; } - if (! queue->accessQueue.lock()) { - LOGGER_FATAL << "cannot lock in " << __FILE__ << "@" << __LINE__; - exit(EXIT_FAILURE); - } + queue->accessQueue.lock(); queue->monopolizer = 0; @@ -224,10 +215,7 @@ namespace triagens { } if (0 < queue->nrWaiting && ! queue->readyJobs.empty()) { - if (! queue->accessQueue.broadcast()) { - LOGGER_FATAL << "cannot broadcast in " << __FILE__ << "@" << __LINE__; - exit(EXIT_FAILURE); - } + queue->accessQueue.broadcast(); } tick(); @@ -238,10 +226,7 @@ namespace triagens { tick(); - if (! queue->accessQueue.wait()) { - LOGGER_FATAL << "cannot wait in " << __FILE__ << "@" << __LINE__; - exit(EXIT_FAILURE); - } + queue->accessQueue.wait(); tick(); @@ -260,10 +245,7 @@ namespace triagens { queue->nrSpecial--; } - if (! queue->accessQueue.unlock()) { - LOGGER_FATAL << "cannot unlock in " << __FILE__ << "@" << __LINE__; - exit(EXIT_FAILURE); - } + queue->accessQueue.unlock(); LOGGER_TRACE << "dispatcher thread has finished"; } diff --git a/Dispatcher/DispatcherThread.h b/Dispatcher/DispatcherThread.h index cc29ae086d..e7e9045d8a 100644 --- a/Dispatcher/DispatcherThread.h +++ b/Dispatcher/DispatcherThread.h @@ -29,7 +29,7 @@ #ifndef TRIAGENS_FYN_DISPATCHER_DISPATCHER_THREAD_H #define TRIAGENS_FYN_DISPATCHER_DISPATCHER_THREAD_H 1 -#include +#include #include #include