Remove dead mutexes

This commit is contained in:
gingerBill
2021-07-13 23:10:12 +01:00
parent 7a9b7af078
commit 69027b6840
3 changed files with 0 additions and 18 deletions
-12
View File
@@ -628,8 +628,6 @@ i64 check_distance_between_types(CheckerContext *c, Operand *operand, Type *type
if (are_types_identical(src, dst)) { if (are_types_identical(src, dst)) {
return 3; return 3;
} }
gb_mutex_lock(&c->checker->poly_proc_mutex);
defer (gb_mutex_unlock(&c->checker->poly_proc_mutex));
PolyProcData poly_proc_data = {}; PolyProcData poly_proc_data = {};
if (check_polymorphic_procedure_assignment(c, operand, type, operand->expr, &poly_proc_data)) { if (check_polymorphic_procedure_assignment(c, operand, type, operand->expr, &poly_proc_data)) {
Entity *e = poly_proc_data.gen_entity; Entity *e = poly_proc_data.gen_entity;
@@ -4402,8 +4400,6 @@ CALL_ARGUMENT_CHECKER(check_call_arguments_internal) {
} else { } else {
// NOTE(bill): Generate the procedure type for this generic instance // NOTE(bill): Generate the procedure type for this generic instance
if (pt->is_polymorphic && !pt->is_poly_specialized) { if (pt->is_polymorphic && !pt->is_poly_specialized) {
gb_mutex_lock(&c->checker->poly_proc_mutex);
PolyProcData poly_proc_data = {}; PolyProcData poly_proc_data = {};
if (find_or_generate_polymorphic_procedure_from_parameters(c, entity, &operands, call, &poly_proc_data)) { if (find_or_generate_polymorphic_procedure_from_parameters(c, entity, &operands, call, &poly_proc_data)) {
gen_entity = poly_proc_data.gen_entity; gen_entity = poly_proc_data.gen_entity;
@@ -4412,8 +4408,6 @@ CALL_ARGUMENT_CHECKER(check_call_arguments_internal) {
} else { } else {
err = CallArgumentError_WrongTypes; err = CallArgumentError_WrongTypes;
} }
gb_mutex_unlock(&c->checker->poly_proc_mutex);
} }
GB_ASSERT(is_type_proc(final_proc_type)); GB_ASSERT(is_type_proc(final_proc_type));
@@ -4686,7 +4680,6 @@ CALL_ARGUMENT_CHECKER(check_named_call_arguments) {
Entity *gen_entity = nullptr; Entity *gen_entity = nullptr;
if (pt->is_polymorphic && !pt->is_poly_specialized && err == CallArgumentError_None) { if (pt->is_polymorphic && !pt->is_poly_specialized && err == CallArgumentError_None) {
gb_mutex_lock(&c->checker->poly_proc_mutex);
PolyProcData poly_proc_data = {}; PolyProcData poly_proc_data = {};
if (find_or_generate_polymorphic_procedure_from_parameters(c, entity, &ordered_operands, call, &poly_proc_data)) { if (find_or_generate_polymorphic_procedure_from_parameters(c, entity, &ordered_operands, call, &poly_proc_data)) {
gen_entity = poly_proc_data.gen_entity; gen_entity = poly_proc_data.gen_entity;
@@ -4695,7 +4688,6 @@ CALL_ARGUMENT_CHECKER(check_named_call_arguments) {
proc_type = gept; proc_type = gept;
pt = &gept->Proc; pt = &gept->Proc;
} }
gb_mutex_unlock(&c->checker->poly_proc_mutex);
} }
@@ -5770,8 +5762,6 @@ ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *call, Ast *pr
operand->type = t_invalid;; operand->type = t_invalid;;
return Expr_Expr; return Expr_Expr;
} }
gb_mutex_lock(&c->checker->poly_type_mutex);
auto err = check_polymorphic_record_type(c, operand, call); auto err = check_polymorphic_record_type(c, operand, call);
if (err == 0) { if (err == 0) {
Ast *ident = operand->expr; Ast *ident = operand->expr;
@@ -5788,8 +5778,6 @@ ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *call, Ast *pr
operand->mode = Addressing_Invalid; operand->mode = Addressing_Invalid;
operand->type = t_invalid; operand->type = t_invalid;
} }
gb_mutex_unlock(&c->checker->poly_type_mutex);
} else { } else {
gbString str = type_to_string(t); gbString str = type_to_string(t);
defer (gb_string_free(str)); defer (gb_string_free(str));
-3
View File
@@ -962,9 +962,6 @@ bool init_checker(Checker *c, Parser *parser) {
gb_semaphore_init(&c->procs_to_check_semaphore); gb_semaphore_init(&c->procs_to_check_semaphore);
mpmc_init(&c->global_untyped_queue, a, 1<<20); mpmc_init(&c->global_untyped_queue, a, 1<<20);
gb_mutex_init(&c->poly_type_mutex);
gb_mutex_init(&c->poly_proc_mutex);
return true; return true;
} }
-3
View File
@@ -380,9 +380,6 @@ struct Checker {
ProcBodyQueue procs_to_check_queue; ProcBodyQueue procs_to_check_queue;
gbSemaphore procs_to_check_semaphore; gbSemaphore procs_to_check_semaphore;
MPMCQueue<UntypedExprInfo> global_untyped_queue; MPMCQueue<UntypedExprInfo> global_untyped_queue;
gbMutex poly_type_mutex;
gbMutex poly_proc_mutex;
}; };