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
1616 end
1717end
1818
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
2321 producer = () -> begin
2422 ttask = current_task (). storage[:tapedtask ]
2523 if length (ttask. produced_val) > 0
@@ -45,6 +43,12 @@ function TapedTask(tf::TapedFunction, args...)
4543 close (produce_ch)
4644 close (consume_ch)
4745 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... )
4852 t = TapedTask (task, tf, produce_ch, consume_ch)
4953 task. storage === nothing && (task. storage = IdDict ())
5054 task. storage[:tapedtask ] = t
You can’t perform that action at this time.
0 commit comments