File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,11 @@ void VulkanRenderManager::StopThread() {
302
302
303
303
INFO_LOG (G3D, " Vulkan submission thread joined. Frame=%d" , vulkan_->GetCurFrame ());
304
304
305
- compileCond_.notify_all ();
305
+ if (compileThread_.joinable ()) {
306
+ // Lock to avoid race conditions.
307
+ std::lock_guard<std::mutex> guard (compileMutex_);
308
+ compileCond_.notify_all ();
309
+ }
306
310
compileThread_.join ();
307
311
INFO_LOG (G3D, " Vulkan compiler thread joined." );
308
312
@@ -360,7 +364,7 @@ void VulkanRenderManager::CompileThreadFunc() {
360
364
std::vector<CompileQueueEntry> toCompile;
361
365
{
362
366
std::unique_lock<std::mutex> lock (compileMutex_);
363
- if (compileQueue_.empty ()) {
367
+ if (compileQueue_.empty () && run_ ) {
364
368
compileCond_.wait (lock);
365
369
}
366
370
toCompile = std::move (compileQueue_);
You can’t perform that action at this time.
0 commit comments