mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-08 08:38:51 +00:00
Narrow type info mutex usage
This commit is contained in:
+2
-3
@@ -1731,10 +1731,7 @@ gb_internal void add_type_info_type(CheckerContext *c, Type *t) {
|
||||
if (build_context.disallow_rtti) {
|
||||
return;
|
||||
}
|
||||
|
||||
mutex_lock(&c->info->type_info_mutex);
|
||||
add_type_info_type_internal(c, t);
|
||||
mutex_unlock(&c->info->type_info_mutex);
|
||||
}
|
||||
|
||||
gb_internal void add_type_info_type_internal(CheckerContext *c, Type *t) {
|
||||
@@ -1751,6 +1748,7 @@ gb_internal void add_type_info_type_internal(CheckerContext *c, Type *t) {
|
||||
|
||||
add_type_info_dependency(c->info, c->decl, t);
|
||||
|
||||
MUTEX_GUARD_BLOCK(&c->info->type_info_mutex) {
|
||||
auto found = map_get(&c->info->type_info_map, t);
|
||||
if (found != nullptr) {
|
||||
// Types have already been added
|
||||
@@ -1779,6 +1777,7 @@ gb_internal void add_type_info_type_internal(CheckerContext *c, Type *t) {
|
||||
// NOTE(bill): If a previous one exists already, no need to continue
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Add nested types
|
||||
|
||||
|
||||
Reference in New Issue
Block a user