# include "pantasks.h"

/** things related to CheckTasks **/

static int CheckTasksRun = FALSE;

void CheckTasksSetState (int state) {
  CheckTasksRun = state;
}
int CheckTasksGetState () {
  return (CheckTasksRun);
}

void *CheckTasksThread (void *data) {

  gprintInit ();  // each thread needs to init the printing system
  while (1) {

    // check for thread suspend
    if (!CheckTasksRun) {
      usleep (100000); // idle if thread action is suspended
      continue;
    }

    // one run of the task checker
    SerialThreadLock ();
    CheckTasks ();
    SerialThreadUnlock ();
    usleep (10000); // allow other threads a chance to run
  }
}

/* the threaded version of pantasks does not worry about limiting the 
   time spent in one of the test loops -- comms with the client are
   in a separate thread anyway...
*/

int TestElapsedCheck () {
  return (FALSE);
}
