#include <oskit/threads/pthread.h>
#include <oskit/threads/cpuinherit.h>int create_fixedpri_scheduler(pthread_t *tid, const pthread_attr_t *attr, int preemptible);
Create a new Fixed Priority scheduler. The pthread_t of the new scheduler is returned in tid. The attributes structure to use when creating the new thread is attr. The preemptible flag indicates whether the new scheduler should use time-based preemption to achieve fairness. Aside from the usual attributes that can be specified, the caller may also specify the new scheduler's scheduler by using pthread_attr_setscheduler. Thus, the caller can set up an arbitrary hierarchy of schedulers and threads.This fixed priority scheduler roughly corresponds to the POSIX pthread scheduler, and implements both FIFO and round robin policies. The standard pthread scheduling interface routines may be used when altering the scheduling parameters for threads that are scheduled by this scheduler.
- tid
- A pointer to the location where the thread id of the new scheduler should be stored.
- attr
- A pointer to the thread creation attributes object.
- preemptible
- A flag indicating whether the new scheduler should use time-based preemption.
Returns 0 on success, or an error code specified in <oskit/error.h>, on error.