We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e2d2ca0 + 0b4ea77 commit fd7cbfaCopy full SHA for fd7cbfa
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