Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
void OSSched (void)

File

Called from

Code enabled by

os_core.c

Task only

N/A

Description

OSSched() allows  allows a task to call the scheduler. You would use this function after doing a series of “posts” where you specified specified OS_OPT_POST_NO_SCHED as  as a post option.

OSSched() can  can only be called by task-level code. Also, if the scheduler is locked (i.e., OSSchedLock() was  was previously called), then then OSSched() will  will have no effect.

If a higher-priority task than the calling task is ready-to-run, OSSched() will  will context switch to that task.

Files

os.h/os_core.c

Prototype

Code Block
void  OSSched (void)

Arguments

None

Returned Value

None

Required Configuration

None

Callers

Application.

Notes/Warnings

None

Example Usage

Code Block
titleOSSched() example usage
          void TaskX (void *p_arg)
          {
              (void)&p_arg;
              while (DEF_ON) {
                  :
                  OS??Post(...);         /* Posts with OS_OPT_POST_NO_SCHED option         */
                  /* Check "err" */
                  :
                  :
                  OS??Post(...);    
                  /* Check "err" */
                  :
                  :
                  OS??Post(...);
                  /* Check "err" */
                  :
                  :
                  OSSched();           /* Run the scheduler                              */
                  :
                  :
              }
          }