Add mutex guards for signature scopes

This commit is contained in:
gingerBill
2022-01-10 14:50:28 +00:00
parent 6f3e450c50
commit 7cc265e14c
7 changed files with 68 additions and 14 deletions

View File

@@ -4021,10 +4021,12 @@ void check_did_you_mean_scope(String const &name, Scope *scope) {
DidYouMeanAnswers d = did_you_mean_make(heap_allocator(), scope->elements.entries.count, name);
defer (did_you_mean_destroy(&d));
mutex_lock(&scope->mutex);
for_array(i, scope->elements.entries) {
Entity *e = scope->elements.entries[i].value;
did_you_mean_append(&d, e->token.string);
}
mutex_unlock(&scope->mutex);
check_did_you_mean_print(&d);
}