mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- fix crash if a worker thread is the first thread to queue drawer commands
This commit is contained in:
parent
3838ec3edc
commit
93908bc2ef
1 changed files with 1 additions and 1 deletions
|
@ -59,11 +59,11 @@ void DrawerThreads::Execute(DrawerCommandQueuePtr commands)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto queue = Instance();
|
auto queue = Instance();
|
||||||
queue->StartThreads();
|
|
||||||
|
|
||||||
// Add to queue and awaken worker threads
|
// Add to queue and awaken worker threads
|
||||||
std::unique_lock<std::mutex> start_lock(queue->start_mutex);
|
std::unique_lock<std::mutex> start_lock(queue->start_mutex);
|
||||||
std::unique_lock<std::mutex> end_lock(queue->end_mutex);
|
std::unique_lock<std::mutex> end_lock(queue->end_mutex);
|
||||||
|
queue->StartThreads();
|
||||||
queue->active_commands.push_back(commands);
|
queue->active_commands.push_back(commands);
|
||||||
queue->tasks_left += queue->threads.size();
|
queue->tasks_left += queue->threads.size();
|
||||||
end_lock.unlock();
|
end_lock.unlock();
|
||||||
|
|
Loading…
Reference in a new issue