Leave lock unlocked after assertNotEntered

This commit is contained in:
Andrew Noyes 2020-04-27 17:57:04 +00:00
parent 50592d58fd
commit 0c78577854
1 changed files with 4 additions and 1 deletions

View File

@ -69,7 +69,10 @@ public:
ANNOTATE_RWLOCK_RELEASED(this, true);
#endif
}
void assertNotEntered() { ASSERT(!isLocked.test_and_set(std::memory_order_acquire)); }
void assertNotEntered() {
ASSERT(!isLocked.test_and_set(std::memory_order_acquire));
isLocked.clear(std::memory_order_release);
}
private:
ThreadSpinLock(const ThreadSpinLock&);