File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 27
27
Base. schedule (t:: StableTask ) = (schedule (t. t); t)
28
28
Base. schedule (t, val; error= false ) = (schedule (t. t, val; error); t)
29
29
30
-
30
+ """
31
+ Similar to `Threads.@spawn` but type-stable. Creates a `Task` and schedules it to run on any available thread in the `:default` threadpool.
32
+ """
31
33
macro spawn (args... )
32
34
tp = QuoteNode (:default )
33
35
na = length (args)
@@ -47,6 +49,7 @@ macro spawn(args...)
47
49
else
48
50
throw (ArgumentError (" wrong number of arguments in @spawn" ))
49
51
end
52
+
50
53
letargs = _lift_one_interp! (ex)
51
54
52
55
thunk = replace_linenums! (:(() -> ($ (esc (ex)))), __source__)
@@ -71,6 +74,10 @@ macro spawn(args...)
71
74
end
72
75
end
73
76
77
+ """
78
+ Similar to `StableTasks.@spawn` but creates a **sticky** `Task` and schedules it to run on the thread with the given id (`thrdid`).
79
+ The task is guaranteed to stay on this thread (it won't migrate to another thread).
80
+ """
74
81
macro spawnat (thrdid, ex)
75
82
letargs = _lift_one_interp! (ex)
76
83
You can’t perform that action at this time.
0 commit comments