@@ -51,30 +51,30 @@ class Task
5151 */
5252 void wait ()
5353 {
54- std::unique_lock<std::mutex> lock (condition_lock );
55- complete_condition .wait (lock, [this ]{ return complete.load (); });
54+ std::unique_lock<std::mutex> lock (conditionLock );
55+ completeCondition .wait (lock, [this ]{ return complete.load (); });
5656 }
5757
5858 /* *
5959 * @brief Notify that the task is complete.
6060 */
6161 void notify ()
6262 {
63- std::unique_lock<std::mutex> lock (condition_lock );
63+ std::unique_lock<std::mutex> lock (conditionLock );
6464 complete = true ;
6565 lock.unlock ();
66- complete_condition .notify_all ();
66+ completeCondition .notify_all ();
6767 }
6868
6969private:
7070 /* * @brief Task completion status. */
7171 std::atomic<bool > complete { false };
7272
7373 /* * @brief Condition variable for notifications. */
74- std::condition_variable complete_condition ;
74+ std::condition_variable completeCondition ;
7575
7676 /* * @brief Lock for notifications. */
77- std::mutex condition_lock ;
77+ std::mutex conditionLock ;
7878};
7979
8080
@@ -86,7 +86,7 @@ class TaskQueue
8686{
8787private:
8888 /* * @brief Lock for thread-safe access. */
89- std::mutex store_lock ;
89+ std::mutex storeLock ;
9090
9191 /* * @brief Condition variable for notifications. */
9292 std::condition_variable condition;
@@ -103,7 +103,7 @@ class TaskQueue
103103 void put (
104104 T task
105105 ) {
106- std::lock_guard<std::mutex> lock (store_lock );
106+ std::lock_guard<std::mutex> lock (storeLock );
107107 store.push_back (task);
108108 condition.notify_one ();
109109 }
@@ -117,7 +117,7 @@ class TaskQueue
117117 */
118118 T get ()
119119 {
120- std::unique_lock<std::mutex> lock (store_lock );
120+ std::unique_lock<std::mutex> lock (storeLock );
121121
122122 // Release lock until we have data, and then reacquire
123123 while (store.empty ())
@@ -138,9 +138,9 @@ class TaskQueue
138138 *
139139 * @return @c true if the queue is empty, @c false otherwise.
140140 */
141- bool is_empty ()
141+ bool isEmpty ()
142142 {
143- std::unique_lock <std::mutex> lock (store_lock );
143+ std::lock_guard <std::mutex> lock (storeLock );
144144 return store.empty ();
145145 }
146146};
0 commit comments