File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -154,16 +154,16 @@ Base.wait(t::ThunkFuture) = Dagger.Sch.thunk_yield() do
154
154
end
155
155
function Base. fetch (t:: ThunkFuture ; proc= OSProc (), raw= false )
156
156
error, value = Dagger. Sch. thunk_yield () do
157
- if raw
158
- fetch (t. future)
159
- else
160
- move (proc, fetch (t. future))
161
- end
157
+ fetch (t. future)
162
158
end
163
159
if error
164
160
throw (value)
165
161
end
166
- value
162
+ if raw
163
+ return value
164
+ else
165
+ return move (proc, value)
166
+ end
167
167
end
168
168
Base. put! (t:: ThunkFuture , x; error= false ) = put! (t. future, (error, x))
169
169
@@ -263,13 +263,7 @@ mutable struct EagerThunk
263
263
end
264
264
Base. isready (t:: EagerThunk ) = isready (t. future)
265
265
Base. wait (t:: EagerThunk ) = wait (t. future)
266
- function Base. fetch (t:: EagerThunk ; raw= false )
267
- if raw
268
- fetch (t. future; raw= true )
269
- else
270
- move (OSProc (), fetch (t. future))
271
- end
272
- end
266
+ Base. fetch (t:: EagerThunk ; raw= false ) = fetch (t. future; raw)
273
267
function Base. show (io:: IO , t:: EagerThunk )
274
268
print (io, " EagerThunk ($(isready (t) ? " finished" : " running" ) )" )
275
269
end
You can’t perform that action at this time.
0 commit comments