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)
4343 res = func ()
4444 ct = current_task ()
4545 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
4948 wait ()
5049 catch ex
5150 ct = current_task ()
5251 ct. exception = ex
5352 ct. result = ex
54- @static if VERSION >= v " 1.1.0"
55- ct. state = :failed
56- end
5753 ct. backtrace = catch_backtrace ()
54+ isa (ct. storage, Nothing) && (ct. storage = IdDict ())
55+ ct. storage[:_libtask_state ] = :failed
5856 wait ()
5957 end
6058end
@@ -173,10 +171,10 @@ consume(p::Task, values...) = begin
173171 Base. schedule (p)
174172 yield ()
175173
174+ isa (p. storage, IdDict) && haskey (p. storage, :_libtask_state ) &&
175+ (p. state = p. storage[:_libtask_state ])
176+
176177 if p. exception != nothing
177- @static if VERSION < v " 1.1.0"
178- p. state = :failed
179- end
180178 throw (p. exception)
181179 end
182180 end
You can’t perform that action at this time.
0 commit comments