aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-07-13 23:10:12 +0100
committergingerBill <bill@gingerbill.org>2021-07-13 23:10:12 +0100
commit69027b6840ae3e46291ff65353eb164ccb2f013e (patch)
treecfdefa8c50ff006708816c72aeb1c9328b292142 /src
parent7a9b7af078da29ca54e4dbd653b4ac0fa46d18c3 (diff)
Remove dead mutexes
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp12
-rw-r--r--src/checker.cpp3
-rw-r--r--src/checker.hpp3
3 files changed, 0 insertions, 18 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 70d8a891f..a789a181e 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -628,8 +628,6 @@ i64 check_distance_between_types(CheckerContext *c, Operand *operand, Type *type
if (are_types_identical(src, dst)) {
return 3;
}
- gb_mutex_lock(&c->checker->poly_proc_mutex);
- defer (gb_mutex_unlock(&c->checker->poly_proc_mutex));
PolyProcData poly_proc_data = {};
if (check_polymorphic_procedure_assignment(c, operand, type, operand->expr, &poly_proc_data)) {
Entity *e = poly_proc_data.gen_entity;
@@ -4402,8 +4400,6 @@ CALL_ARGUMENT_CHECKER(check_call_arguments_internal) {
} else {
// NOTE(bill): Generate the procedure type for this generic instance
if (pt->is_polymorphic && !pt->is_poly_specialized) {
- gb_mutex_lock(&c->checker->poly_proc_mutex);
-
PolyProcData 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;
@@ -4412,8 +4408,6 @@ CALL_ARGUMENT_CHECKER(check_call_arguments_internal) {
} else {
err = CallArgumentError_WrongTypes;
}
-
- gb_mutex_unlock(&c->checker->poly_proc_mutex);
}
GB_ASSERT(is_type_proc(final_proc_type));
@@ -4686,7 +4680,6 @@ CALL_ARGUMENT_CHECKER(check_named_call_arguments) {
Entity *gen_entity = nullptr;
if (pt->is_polymorphic && !pt->is_poly_specialized && err == CallArgumentError_None) {
- gb_mutex_lock(&c->checker->poly_proc_mutex);
PolyProcData 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;
@@ -4695,7 +4688,6 @@ CALL_ARGUMENT_CHECKER(check_named_call_arguments) {
proc_type = gept;
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;;
return Expr_Expr;
}
- gb_mutex_lock(&c->checker->poly_type_mutex);
-
auto err = check_polymorphic_record_type(c, operand, call);
if (err == 0) {
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->type = t_invalid;
}
-
- gb_mutex_unlock(&c->checker->poly_type_mutex);
} else {
gbString str = type_to_string(t);
defer (gb_string_free(str));
diff --git a/src/checker.cpp b/src/checker.cpp
index c71a75503..9c13ba478 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -962,9 +962,6 @@ bool init_checker(Checker *c, Parser *parser) {
gb_semaphore_init(&c->procs_to_check_semaphore);
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;
}
diff --git a/src/checker.hpp b/src/checker.hpp
index 2fe7e8542..46742a7d6 100644
--- a/src/checker.hpp
+++ b/src/checker.hpp
@@ -380,9 +380,6 @@ struct Checker {
ProcBodyQueue procs_to_check_queue;
gbSemaphore procs_to_check_semaphore;
MPMCQueue<UntypedExprInfo> global_untyped_queue;
-
- gbMutex poly_type_mutex;
- gbMutex poly_proc_mutex;
};