diff options
| author | gingerBill <bill@gingerbill.org> | 2021-07-10 15:14:25 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-07-10 15:14:25 +0100 |
| commit | 9f7154a03941f1ffad629e8e558040911e9886ba (patch) | |
| tree | 6caea41c1fa95b592e630b2f007099ae0b46f2cc /src/check_decl.cpp | |
| parent | 4a932616fc6d8d5c4cad98debf292a1916e5a2be (diff) | |
Prepare for multithreading the semantic checker by giving mutexes to variables of contention
NOTE(bill): I know this is dodgy, but I want to make sure it is correct logic before improve those data structures
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index a2c40c9a2..84817e9d8 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -786,6 +786,7 @@ void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) { GB_ASSERT(pl->body->kind == Ast_BlockStmt); if (!pt->is_polymorphic) { + // check_procedure_now(ctx->checker, ctx->file, e->token, d, proc_type, pl->body, pl->tags); check_procedure_later(ctx->checker, ctx->file, e->token, d, proc_type, pl->body, pl->tags); } } else if (!is_foreign) { @@ -808,7 +809,9 @@ void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) { if (ac.deferred_procedure.entity != nullptr) { e->Procedure.deferred_procedure = ac.deferred_procedure; + gb_mutex_lock(&ctx->checker->procs_with_deferred_to_check_mutex); array_add(&ctx->checker->procs_with_deferred_to_check, e); + gb_mutex_unlock(&ctx->checker->procs_with_deferred_to_check_mutex); } if (is_foreign) { |