?? LEFT := 1, RIGHT := 110 ??
MODULE sym$system_task_services;
{
{ This module contains the routines which system tasks use:
{        .to poll the system for the next state of the task
{        .to wait until the system is ready to resume after an idle.
{ This module is located on the following library:
{        OSF$JOB_TEMPLATE_2DD
{
?? PUSH (LISTEXT := ON) ??
*copyc ose$system_task_exceptions
*copyc ost$status
?? POP ??
*copyc syt$system_task_status
*copyc osp$active_system_task
*copyc osp$idle_requested
*copyc pmp$wait
?? OLDTITLE, NEWTITLE := '  PROCEDURE syp$get_system_task_status', EJECT ??

  PROCEDURE [XDCL, #GATE] syp$get_system_task_status (VAR task_status: syt$system_task_status);

*copyc syh$get_system_task_status

    IF osp$idle_requested () THEN
      task_status := syc$sts_idle_down_in_progress;
    ELSEIF osp$active_system_task () THEN
      task_status := syc$sts_ok;
    ELSE
      task_status := syc$sts_deactivate_requested;
    IFEND;

  PROCEND syp$get_system_task_status;
?? OLDTITLE, NEWTITLE := '  PROCEDURE syp$wait_system_resume', EJECT ??

  PROCEDURE [XDCL, #GATE] syp$wait_system_resume;

*copyc syh$wait_system_resume

    CONST
      one_second = 1000000;

    WHILE osp$idle_requested () DO
      pmp$wait (one_second, one_second);
    WHILEND;

  PROCEND syp$wait_system_resume;
?? OLDTITLE ??
MODEND sym$system_task_services;
