Reduce mutex usage and convert things to queues from arrays

This commit is contained in:
gingerBill
2021-07-13 23:09:24 +01:00
parent 31c7afce1b
commit 7a9b7af078
5 changed files with 204 additions and 118 deletions

View File

@@ -901,9 +901,7 @@ void check_global_variable_decl(CheckerContext *ctx, Entity *&e, Ast *type_expr,
}
if (ac.require_declaration) {
gb_mutex_lock(&ctx->info->entity_mutex);
array_add(&ctx->info->required_global_variables, e);
gb_mutex_unlock(&ctx->info->entity_mutex);
mpmc_enqueue(&ctx->info->required_global_variable_queue, e);
}