IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42173


Ignore:
Timestamp:
Apr 18, 2022, 10:26:42 AM (4 years ago)
Author:
eugene
Message:

stop pcontrol threads and exit before shutting down

Location:
branches/eam_branches/ipp-20220316/Ohana/src/opihi
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20220316/Ohana/src/opihi/include/pcontrol.h

    r36623 r42173  
    341341
    342342void pcontrol_exit (int n);
     343void QuitCheckSystemThread (void);
    343344
    344345// Job   *FindJobByID (IDtype JobID, int *StackID);
  • branches/eam_branches/ipp-20220316/Ohana/src/opihi/pcontrol/CheckSystem.c

    r39457 r42173  
    44static struct timeval lastlive = {0, 0};
    55static RunLevels RunLevel = PCONTROL_RUN_NONE;
     6
     7static int CheckSystemThreadRuns = TRUE;
     8
     9void QuitCheckSystemThread (void) {
     10  CheckSystemThreadRuns = FALSE; 
     11}
     12
    613
    714RunLevels SetRunLevel (RunLevels level) {
     
    6774  gprintInit ();
    6875
    69   while (1) {
     76  while (CheckSystemThreadRuns) {
    7077    // stop here if the user-thread requests (no objects in flight)
    7178    TestCheckPoint ();
  • branches/eam_branches/ipp-20220316/Ohana/src/opihi/pcontrol/pcontrol.c.in

    r39457 r42173  
    99# define opihi_rcfile ".pcontrolrc"
    1010
     11# ifdef THREADED 
     12  static pthread_t clientsThread;
     13# endif
     14
    1115/* program-dependent initialization */
    1216void program_init (int *argc, char **argv) {
     
    1418  OHANA_UNUSED_PARAM(argv);
    1519 
    16 # ifdef THREADED 
    17   pthread_t clientsThread;
    18 # endif
    19 
    2020  auto_break = TRUE;
    2121
     
    8383  SetRunLevel (PCONTROL_RUN_HOSTS);
    8484  DownHosts ();
     85
     86  QuitCheckSystemThread(); pthread_join (clientsThread, NULL);
     87
    8588  ConfigFree ();
    86 
    8789  FreeBasic ();
    8890  FreePcontrol ();
  • branches/eam_branches/ipp-20220316/Ohana/src/opihi/pcontrol/test/linesize.sh

    r18114 r42173  
    2727
    2828  for i 1 10
    29     job echo $inline7
     29    job echo $inline6
    3030  end
    3131
     
    3434  for i 1 10
    3535    stdout $i -var outline
    36     strlen "$inline7" Nin
     36    strlen "$inline6" Nin
    3737    strlen "$outline" Nout
    3838
Note: See TracChangeset for help on using the changeset viewer.