IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 3, 2021, 2:12:35 PM (5 years ago)
Author:
eugene
Message:

stop threads before freeing data when QUIT is called; fuzz added to last task execution was not correctly added to usec -- this made fast tasks run many invalid attempts

File:
1 edited

Legend:

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

    r39457 r41483  
    77# define opihi_rcfile ".pantasksrc"
    88
     9static pthread_t JobsAndTasksThread;
     10static pthread_t controllerThread;
     11
    912/* program-dependent initialization */
    1013void program_init (int *argc, char **argv) {
     
    1215  OHANA_UNUSED_PARAM(argv);
    1316 
    14   pthread_t JobsAndTasksThread;
    15   pthread_t controllerThread;
    16 
    1717  auto_break = TRUE;
    1818
     
    6767/* add program-dependent exit functions here */
    6868void cleanup () {
     69  // stop the threads before calling the free functions
    6970  QuitKapa ();
    7071  QuitController ();
    7172  ConfigFree ();
     73
     74  // tell the threads to exit and wait for them to exit
     75  QuitJobsAndTasksThread(); pthread_join (JobsAndTasksThread, NULL);
     76  QuitControllerThread(); pthread_join (controllerThread, NULL);
    7277
    7378  FreeBasic ();
Note: See TracChangeset for help on using the changeset viewer.