Use mutex_try_lock in check_proc_info

This commit is contained in:
gingerBill
2023-01-02 20:42:22 +00:00
parent 09c26e6be0
commit df2767311f
+4 -1
View File
@@ -5050,7 +5050,10 @@ gb_internal bool check_proc_info(Checker *c, ProcInfo *pi, UntypedExprInfoMap *u
return false; return false;
} }
MUTEX_GUARD(&pi->decl->proc_checked_mutex); if (!mutex_try_lock(&pi->decl->proc_checked_mutex)) {
return false;
}
defer (mutex_unlock(&pi->decl->proc_checked_mutex));
Entity *e = pi->decl->entity; Entity *e = pi->decl->entity;
switch (pi->decl->proc_checked_state.load()) { switch (pi->decl->proc_checked_state.load()) {