Skip to content

Commit e0748ae

Browse files
committed
Use _Atomic for configuration.isFinished
1 parent c210b51 commit e0748ae

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

SwiftTask/SwiftTask.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ public class TaskConfiguration
3232
public var cancel: (Void -> Void)?
3333

3434
/// useful to terminate immediate-infinite-sequence while performing `initClosure`
35-
public private(set) var isFinished: Bool = false
36-
37-
public init()
35+
public var isFinished : Bool
3836
{
39-
37+
return _isFinished.rawValue
4038
}
4139

40+
private var _isFinished = _Atomic(false)
41+
4242
internal func finish()
4343
{
4444
//
@@ -53,7 +53,7 @@ public class TaskConfiguration
5353
self.pause = nil
5454
self.resume = nil
5555
self.cancel = nil
56-
self.isFinished = true
56+
self._isFinished.rawValue = true
5757
}
5858
}
5959

0 commit comments

Comments
 (0)