Skip to content

Commit

Permalink
thread: fix MacOS synchronization error
Browse files Browse the repository at this point in the history
  • Loading branch information
quesnel committed Apr 3, 2024
1 parent 8eca907 commit 7385f28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/test/threading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ int main()
irt::spin_lock mutex_2;

for (int i = 0; i < 100; ++i) {
int mult = 0;
std::atomic_int mult = 0;

std::thread j1([&mult, &mutex_1]() {
std::scoped_lock lock(mutex_1);
Expand All @@ -122,7 +122,7 @@ int main()
j2.join();
j3.join();

expect(eq(mult, 111));
expect(eq(mult.load(), 111));
}
};

Expand Down

0 comments on commit 7385f28

Please sign in to comment.