File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -205,20 +205,18 @@ class CCheckQueue
205205 * queue is finished before continuing.
206206 */
207207template <typename T, typename R = std::remove_cvref_t <decltype (std::declval<T>()().value())>>
208- class CCheckQueueControl
208+ class SCOPED_LOCKABLE CCheckQueueControl
209209{
210210private:
211211 CCheckQueue<T, R>& m_queue;
212+ UniqueLock<Mutex> m_lock;
212213 bool fDone ;
213214
214215public:
215216 CCheckQueueControl () = delete ;
216217 CCheckQueueControl (const CCheckQueueControl&) = delete ;
217218 CCheckQueueControl& operator =(const CCheckQueueControl&) = delete ;
218- explicit CCheckQueueControl (CCheckQueue<T>& queueIn) : m_queue(queueIn), fDone(false )
219- {
220- ENTER_CRITICAL_SECTION (m_queue.m_control_mutex );
221- }
219+ explicit CCheckQueueControl (CCheckQueue<T>& queueIn) EXCLUSIVE_LOCK_FUNCTION(queueIn.m_control_mutex) : m_queue(queueIn), m_lock(LOCK_ARGS(queueIn.m_control_mutex)), fDone(false ) {}
222220
223221 std::optional<R> Complete ()
224222 {
@@ -232,11 +230,10 @@ class CCheckQueueControl
232230 m_queue.Add (std::move (vChecks));
233231 }
234232
235- ~CCheckQueueControl ()
233+ ~CCheckQueueControl () UNLOCK_FUNCTION()
236234 {
237235 if (!fDone )
238236 Complete ();
239- LEAVE_CRITICAL_SECTION (m_queue.m_control_mutex );
240237 }
241238};
242239
You can’t perform that action at this time.
0 commit comments