Skip to content

Commit 6d862d6

Browse files
authored
Merge pull request #1261 from spevans/pr_nslocktest_fix
2 parents 57fb8d2 + 5e392a4 commit 6d862d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

TestFoundation/TestNSLock.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ class TestNSLock: XCTestCase {
4141
}
4242

4343
let thread = Thread() {
44+
lock.lock()
45+
46+
// Now wake up the main thread so it can try to obtain the lock that
47+
// this thread just obtained.
4448
condition.lock()
4549
condition.signal()
4650
condition.unlock()
4751

48-
lock.lock()
4952
Thread.sleep(forTimeInterval: 8)
5053
lock.unlock()
5154
}

0 commit comments

Comments
 (0)