mirror of
https://gitea.tendokyu.moe/Hay1tsme/segatools.git
synced 2026-08-27 22:34:25 -05:00
util/async.c: Small locking fix
This commit is contained in:
@@ -60,6 +60,8 @@ HRESULT async_submit(struct async *async, struct irp *irp, async_task_t task)
|
||||
return task(async->ctx, irp);
|
||||
}
|
||||
|
||||
EnterCriticalSection(&async->lock);
|
||||
|
||||
if (async->thread == NULL) {
|
||||
/* Ensure our worker thread is running */
|
||||
async->thread = (HANDLE) _beginthreadex(
|
||||
@@ -75,8 +77,6 @@ HRESULT async_submit(struct async *async, struct irp *irp, async_task_t task)
|
||||
}
|
||||
}
|
||||
|
||||
EnterCriticalSection(&async->lock);
|
||||
|
||||
while (async->task != NULL) {
|
||||
ok = SleepConditionVariableCS(&async->avail, &async->lock, INFINITE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user