IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 11, 2007, 10:56:27 AM (19 years ago)
Author:
eugene
Message:

adding intelligent timeouts to task and job threads; removing deprecated files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/job_threads.c

    r11898 r12404  
    1414void *CheckJobsThread (void *data) {
    1515
     16  float next_timeout;
     17
    1618  gprintInit ();  // each thread needs to init the printing system
    1719  while (1) {
     
    2527    // one run of the task checker
    2628    SerialThreadLock ();
    27     CheckJobs ();
     29    next_timeout = CheckJobs ();
    2830    SerialThreadUnlock ();
    2931    if (VerboseMode() == 2) fprintf (stderr, "J");
    30     // fprintf (stderr, "J");
    31     // usleep (10000); // allow other threads a chance to run
     32
     33    next_timeout = MIN (next_timeout, 0.1);
     34    if (next_timeout > 0.001) {
     35      usleep ((int)(1000000*next_timeout)); // allow other threads a chance to run
     36    }     
    3237  }
    3338}
Note: See TracChangeset for help on using the changeset viewer.