pub struct SingleThreadedSchedulerClient { /* private fields */ }
Expand description
| Class used by CScheduler clients which | may schedule multiple jobs which are | required to be run serially. | | Jobs may not be run on the same thread, | but no two jobs will be executed at the | same time and memory will be release-acquire | consistent (the scheduler will internally | do an acquire before invoking a callback | as well as a release at the end). | | In practice this means that a callback | | B() will be able to observe all of the | effects of callback A() which executed | before it. |
Implementations§
source§impl SingleThreadedSchedulerClient
impl SingleThreadedSchedulerClient
pub fn new(pscheduler_in: *mut Scheduler) -> Self
pub fn maybe_schedule_process_queue(&mut self)
pub fn process_queue(&mut self)
sourcepub fn add_to_process_queue(&mut self, func: fn())
pub fn add_to_process_queue(&mut self, func: fn())
| Add a callback to be executed. Callbacks | are executed serially and memory is | release-acquire consistent between | callback executions. | | Practically, this means that callbacks | can behave as if they are executed in | order by a single thread. |
sourcepub fn empty_queue(&mut self)
pub fn empty_queue(&mut self)
| Processes all remaining queue members | on the calling thread, blocking until | queue is empty | | Must be called after the CScheduler | has no remaining processing threads! |