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 @@ -22,7 +22,7 @@ The following example demonstrates such a situation:
22
22
import Dispatch
23
23
24
24
actor Caplin {
25
- let queue: DispatchSerialQueue(label: "CoolQueue")
25
+ let queue: DispatchSerialQueue = . init (label : " CoolQueue" )
26
26
27
27
var num: Int // actor isolated state
28
28
@@ -35,9 +35,9 @@ actor Caplin {
35
35
queue.async {
36
36
// guaranteed to execute on `queue`
37
37
// which is the same as self's serial executor
38
- queue.assertIsolated () // CRASH: Incorrect actor executor assumption
39
- self .assumeIsolated { // CRASH: Incorrect actor executor assumption
40
- num += 1
38
+ self . queue .assertIsolated () // CRASH: Incorrect actor executor assumption
39
+ self .assumeIsolated { caplin in // CRASH: Incorrect actor executor assumption
40
+ caplin. num += 1
41
41
}
42
42
}
43
43
}
You can’t perform that action at this time.
0 commit comments