From 9f7154a03941f1ffad629e8e558040911e9886ba Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 10 Jul 2021 15:14:25 +0100 Subject: 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 --- src/check_decl.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/check_decl.cpp') 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) { -- cgit v1.2.3