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
205
205
* queue is finished before continuing.
206
206
*/
207
207
template <typename T, typename R = std::remove_cvref_t <decltype (std::declval<T>()().value())>>
208
- class CCheckQueueControl
208
+ class SCOPED_LOCKABLE CCheckQueueControl
209
209
{
210
210
private:
211
211
CCheckQueue<T, R>& m_queue;
212
+ UniqueLock<Mutex> m_lock;
212
213
bool fDone ;
213
214
214
215
public:
215
216
CCheckQueueControl () = delete ;
216
217
CCheckQueueControl (const CCheckQueueControl&) = delete ;
217
218
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 ) {}
222
220
223
221
std::optional<R> Complete ()
224
222
{
@@ -232,11 +230,10 @@ class CCheckQueueControl
232
230
m_queue.Add (std::move (vChecks));
233
231
}
234
232
235
- ~CCheckQueueControl ()
233
+ ~CCheckQueueControl () UNLOCK_FUNCTION()
236
234
{
237
235
if (!fDone )
238
236
Complete ();
239
- LEAVE_CRITICAL_SECTION (m_queue.m_control_mutex );
240
237
}
241
238
};
242
239
You can’t perform that action at this time.
0 commit comments