Replace condition+mutex with futex

This commit is contained in:
gingerBill
2023-01-02 00:26:17 +00:00
parent d16ddf7926
commit 3c90a05957
3 changed files with 39 additions and 40 deletions
+2 -1
View File
@@ -1935,7 +1935,7 @@ gb_internal void add_type_info_type_internal(CheckerContext *c, Type *t) {
gb_global bool global_procedure_body_in_worker_queue = false;
gb_global std::atomic<bool> global_procedure_body_in_worker_queue = false;
gb_internal void check_procedure_later(CheckerContext *c, ProcInfo *info) {
GB_ASSERT(info != nullptr);
@@ -5264,6 +5264,7 @@ gb_internal WORKER_TASK_PROC(thread_proc_body) {
gb_internal void check_procedure_bodies(Checker *c) {
GB_ASSERT(c != nullptr);
u32 thread_count = cast(u32)gb_max(build_context.thread_count, 1);
u32 worker_count = thread_count-1; // NOTE(bill): The main thread will also be used for work
if (!build_context.threaded_checker) {