Skip to content

Commit 60bc85c

Browse files
committed
fix thread safety errors
1 parent 12ea017 commit 60bc85c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ggml/src/ggml-vulkan/ggml-vulkan.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12384,7 +12384,10 @@ static void ggml_vk_synchronize(ggml_backend_vk_context * ctx) {
1238412384
}
1238512385

1238612386
if (ctx->submit_pending) {
12387-
ctx->device->compute_queue.queue.submit({}, ctx->fence);
12387+
{
12388+
std::lock_guard<std::mutex> guard(queue_mutex);
12389+
ctx->device->compute_queue.queue.submit({}, ctx->fence);
12390+
}
1238812391
ggml_vk_wait_for_fence(ctx);
1238912392
ctx->submit_pending = false;
1239012393
}

0 commit comments

Comments
 (0)