File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,8 @@ struct TapedTask
16
16
end
17
17
end
18
18
19
- function TapedTask (tf:: TapedFunction , args... )
20
- produce_ch = Channel ()
21
- consume_ch = Channel {Int} ()
22
- task = @task try
19
+ function wrap_task (tf, produce_ch, consume_ch, args... )
20
+ try
23
21
producer = () -> begin
24
22
ttask = current_task (). storage[:tapedtask ]
25
23
if length (ttask. produced_val) > 0
@@ -45,6 +43,12 @@ function TapedTask(tf::TapedFunction, args...)
45
43
close (produce_ch)
46
44
close (consume_ch)
47
45
end
46
+ end
47
+
48
+ function TapedTask (tf:: TapedFunction , args... )
49
+ produce_ch = Channel ()
50
+ consume_ch = Channel {Int} ()
51
+ task = @task wrap_task (tf, produce_ch, consume_ch, args... )
48
52
t = TapedTask (task, tf, produce_ch, consume_ch)
49
53
task. storage === nothing && (task. storage = IdDict ())
50
54
task. storage[:tapedtask ] = t
You can’t perform that action at this time.
0 commit comments