aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-01-03 15:26:47 +0000
committergingerBill <bill@gingerbill.org>2023-01-03 15:26:47 +0000
commitc7a704d345e9bda38da18807a1d7cd5bc5accc17 (patch)
tree230117068173a8052495272c2f2ed03a616c0c11 /src/check_stmt.cpp
parent0fb3032b731b640a2d0d1d62b9f8dd548e224b0e (diff)
Use `RwMutex` for the `Scope`
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;