Avatar
@swift-4.2.4 @swift-4.1.3 -Onone import Foundation import SwiftBacktrace enablePrettyStackTrace() let group = DispatchGroup() var array = [Int]() DispatchQueue.global().async(group: group) { for i in 0...1000000 { array.append(i) } print("end 1: \(array.count)") } DispatchQueue.global().async(group: group) { for i in 0...1000000 { array.append(i) } print("end 2: \(array.count)") } group.wait()