diff options
| author | gingerBill <bill@gingerbill.org> | 2023-01-02 00:26:17 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-01-02 00:26:17 +0000 |
| commit | 3c90a059571cb879a468a00c0ca26c9a35090c38 (patch) | |
| tree | 01ac6c50d2c0589bf21b07bccf1d73bf30aba83b /src/checker.cpp | |
| parent | d16ddf7926935e66057239194bbcb699409fafdf (diff) | |
Replace condition+mutex with futex
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 7141b0698..03ff901eb 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -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) { |