File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,8 @@ class TestNSLock: XCTestCase {
69
69
func test_threadsAndLocks( ) {
70
70
let condition = NSCondition ( )
71
71
let lock = NSLock ( )
72
- let threadCount = 1000
73
- let endSeconds : Double = 10
72
+ let threadCount = 10
73
+ let endSeconds : Double = 2
74
74
75
75
let endTime = Date . init ( timeIntervalSinceNow: endSeconds)
76
76
var threadsStarted = Array < Bool > ( repeating: false , count: threadCount)
@@ -85,8 +85,8 @@ class TestNSLock: XCTestCase {
85
85
condition. lock ( )
86
86
condition. wait ( )
87
87
condition. unlock ( )
88
- for _ in 1 ... 100 {
89
- let r = ( endSeconds * drand48( ) ) / 100
88
+ for _ in 1 ... 50 {
89
+ let r = ( endSeconds * drand48( ) ) / 50
90
90
Thread . sleep ( forTimeInterval: r)
91
91
if lock. lock ( before: endTime) {
92
92
lock. unlock ( )
You can’t perform that action at this time.
0 commit comments