Represents a job stored in the heap. Used to implement
scope. Unlike StackJob, when executed, HeapJob simply
invokes a closure, which then triggers the appropriate logic to
signal that the job executed.
A job that will be owned by a stack slot. This means that when it
executes it need not free any heap data, the cleanup occurs when
the stack frame is later popped. The function parameter indicates
true if the job was stolen โ executed on a different thread.
A Job is used to advertise work for other threads that they may
want to steal. In accordance with time honored tradition, jobs are
arranged in a deque, so that thieves can take from the top of the
deque while the main worker manages the bottom of the deque. This
deque is managed by the thread_pool module.