aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index e075297a4..6e84d0789 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -622,7 +622,10 @@ gb_internal bool check_using_stmt_entity(CheckerContext *ctx, AstUsingStmt *us,
case Entity_ImportName: {
Scope *scope = e->ImportName.scope;
- MUTEX_GUARD_BLOCK(scope->mutex) for (auto const &entry : scope->elements) {
+ rw_mutex_lock(&scope->mutex);
+ defer (rw_mutex_unlock(&scope->mutex));
+
+ for (auto const &entry : scope->elements) {
String name = entry.key.string;
Entity *decl = entry.value;
if (!is_entity_exported(decl)) continue;