-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
Lines 255 to 272 in 69a6b09
| macro tspawnat(thrdid, expr) | |
| thunk = esc(:(()->($expr))) | |
| var = esc(Base.sync_varname) | |
| tid = esc(thrdid) | |
| quote | |
| if $tid < 1 || $tid > Threads.nthreads() | |
| throw(AssertionError("@tspawnat thread assignment ($($tid)) must be between 1 and Threads.nthreads() (1:$(Threads.nthreads()))")) | |
| end | |
| local task = Task($thunk) | |
| task.sticky = false | |
| ccall(:jl_set_task_tid, Cvoid, (Any, Cint), task, $tid-1) | |
| if $(Expr(:isdefined, var)) | |
| push!($var, task) | |
| end | |
| schedule(task) | |
| task | |
| end | |
| end |
Could the interpolation syntax support present in Threads.@spawn be added here? Looks like it could be done fairly easily with a bit of copy-paste:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels