File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -43,18 +43,16 @@ function task_wrapper(func)
43
43
res = func ()
44
44
ct = current_task ()
45
45
ct. result = res
46
- @static if VERSION >= v " 1.1.0"
47
- ct. state = :done
48
- end
46
+ isa (ct. storage, Nothing) && (ct. storage = IdDict ())
47
+ ct. storage[:_libtask_state ] = :done
49
48
wait ()
50
49
catch ex
51
50
ct = current_task ()
52
51
ct. exception = ex
53
52
ct. result = ex
54
- @static if VERSION >= v " 1.1.0"
55
- ct. state = :failed
56
- end
57
53
ct. backtrace = catch_backtrace ()
54
+ isa (ct. storage, Nothing) && (ct. storage = IdDict ())
55
+ ct. storage[:_libtask_state ] = :failed
58
56
wait ()
59
57
end
60
58
end
@@ -173,10 +171,10 @@ consume(p::Task, values...) = begin
173
171
Base. schedule (p)
174
172
yield ()
175
173
174
+ isa (p. storage, IdDict) && haskey (p. storage, :_libtask_state ) &&
175
+ (p. state = p. storage[:_libtask_state ])
176
+
176
177
if p. exception != nothing
177
- @static if VERSION < v " 1.1.0"
178
- p. state = :failed
179
- end
180
178
throw (p. exception)
181
179
end
182
180
end
You can’t perform that action at this time.
0 commit comments