Skip to content

Commit

Permalink
Поправка теста для работы с iOS < 10
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyKrupov committed Nov 21, 2018
1 parent 51f3b04 commit 3186349
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Tests/Test_Threadsafety.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,18 @@ final class Test_Threadsafety: XCTestCase {

// Явно создаю 2 потока, т.к. не известно на скольких потоках будет работать concurrent dispatch queue

let expectation1 = expectation(description: "Thread-1")
Thread.detachNewThread {
let queue1 = DispatchQueue(label: "Queue1")
let expectation1 = expectation(description: "Queue-1")
queue1.async {
for _ in 1 ..< 10 {
_ = assembly.someObject
}
expectation1.fulfill()
}

let expectation2 = expectation(description: "Thread-2")
Thread.detachNewThread {
let queue2 = DispatchQueue(label: "Queue2")
let expectation2 = expectation(description: "Queue-2")
queue2.async {
for _ in 1 ..< 10 {
_ = assembly.someObject
}
Expand Down

0 comments on commit 3186349

Please sign in to comment.