PebbleOS v4.47.0-512-g5285d4236
Loading...
Searching...
No Matches
Scheduler

Scheduler start and preemption control. More...

Functions

bool pbl_kernel_is_started (void)
 Check whether the scheduler has started.
 
bool pbl_kernel_is_running (void)
 Check whether threads are being scheduled.
 
void pbl_sched_lock (void)
 Disable preemption.
 
void pbl_sched_unlock (void)
 Undo one pbl_sched_lock(), performing any deferred switch at the outermost one.
 
bool pbl_sched_is_locked (void)
 Check whether preemption is disabled.
 

Detailed Description

Scheduler start and preemption control.

pbl_sched_lock() keeps the calling thread running without masking interrupts: switches requested meanwhile, e.g. by an ISR waking a higher priority thread, happen at the outermost pbl_sched_unlock(). Blocking while the scheduler is locked is not allowed.

prv_update_shared_state();
void pbl_sched_lock(void)
Disable preemption.
void pbl_sched_unlock(void)
Undo one pbl_sched_lock(), performing any deferred switch at the outermost one.

Function Documentation

◆ pbl_kernel_is_running()

bool pbl_kernel_is_running ( void  )

Check whether threads are being scheduled.

Returns
true if the scheduler has started and is not locked.

◆ pbl_kernel_is_started()

bool pbl_kernel_is_started ( void  )

Check whether the scheduler has started.

Returns
true once the scheduler is running threads.

◆ pbl_sched_is_locked()

bool pbl_sched_is_locked ( void  )

Check whether preemption is disabled.

Returns
true while pbl_sched_lock() is in effect.

◆ pbl_sched_lock()

void pbl_sched_lock ( void  )

Disable preemption.

ISRs still run. Nestable; balance each call with pbl_sched_unlock().

◆ pbl_sched_unlock()

void pbl_sched_unlock ( void  )

Undo one pbl_sched_lock(), performing any deferred switch at the outermost one.