Skip to content

Commit

Permalink
add minimal docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenbauer committed Jan 29, 2024
1 parent b127c45 commit 66c9c6c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/internals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ end
Base.schedule(t::StableTask) = (schedule(t.t); t)
Base.schedule(t, val; error=false) = (schedule(t.t, val; error); t)


"""
Similar to `Threads.@spawn` but type-stable. Creates a `Task` and schedules it to run on any available thread in the `:default` threadpool.
"""
macro spawn(ex)
letargs = _lift_one_interp!(ex)

Expand Down Expand Up @@ -55,6 +57,10 @@ macro spawn(ex)
end
end

"""
Similar to `StableTasks.@spawn` but creates a **sticky** `Task` and schedules it to run on the thread with the given id (`thrdid`).
The task is guaranteed to stay on this thread (it won't migrate to another thread).
"""
macro spawnat(thrdid, ex)
letargs = _lift_one_interp!(ex)

Expand Down

0 comments on commit 66c9c6c

Please sign in to comment.