We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5b17976 + 0fa5914 commit 5134c21Copy full SHA for 5134c21
lib/Threading/C11.cpp
@@ -43,9 +43,9 @@ class C11ThreadingHelper {
43
void once_unlock() { SWIFT_C11THREADS_CHECK(mtx_unlock(&onceMutex_)); }
44
void once_broadcast() { SWIFT_C11THREADS_CHECK(cnd_broadcast(&onceCond_)); }
45
void once_wait() {
46
- SWIFT_C11THREADS_CHECK(mtx_lock(&onceMutex_));
+ // The mutex must be locked when this function is entered. It will
47
+ // be locked again before the function returns.
48
SWIFT_C11THREADS_CHECK(cnd_wait(&onceCond_, &onceMutex_));
- SWIFT_C11THREADS_CHECK(mtx_unlock(&onceMutex_));
49
}
50
};
51
0 commit comments