aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2026-02-02 12:04:21 +0000
committerGitHub <noreply@github.com>2026-02-02 12:04:21 +0000
commit80c948277455eb9deaf79ac910fdc8957038fb75 (patch)
treed95cb469a8dab31c15ea61b0f378066f3b7597eb /src/checker.cpp
parent813b622dcc8ba6f7b330a310fc324fccb33a2264 (diff)
parenta936f3fb7d3f6e6abf5e2599b7043625a1a0c17b (diff)
Merge pull request #6217 from odin-lang/bill/threading-fixes-2026-02
Fix to frontend threading bugs
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 9568b8cfa..71ccfebc4 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -495,15 +495,18 @@ gb_internal Entity *scope_insert_with_name(Scope *s, String const &name, Entity
goto end;
}
if (s->parent != nullptr && (s->parent->flags & ScopeFlag_Proc) != 0) {
+ rw_mutex_shared_lock(&s->parent->mutex);
found = string_map_get(&s->parent->elements, key);
if (found) {
if ((*found)->flags & EntityFlag_Result) {
if (entity != *found) {
result = *found;
}
+ rw_mutex_shared_unlock(&s->parent->mutex);
goto end;
}
}
+ rw_mutex_shared_unlock(&s->parent->mutex);
}
string_map_set(&s->elements, key, entity);