
#include<stdio.h>
#include<unistd.h>
#include<sys/wait.h>
#include<netinet/in.h>
#include<string.h>
#include<stdlib.h>
#include<signal.h>
#include<pthread.h>

#include"sitar.h"
#include"sitar_com.h"
#include<almemsys/almemsys.h>
#include"jpreturn.h"
#include<file_comp/file_comp.h>

extern global_data_t gd;
extern pthread_mutex_t name_mutex;


int th_miname_dump(void) 
{

#ifdef TH_MINAME_BUG
printf("th_miname_dump(): loop int =%d\n", gd.td.midint);
#endif

for(;;){
   safe_pthread_mutex_lock(&name_mutex);
   if(gd.td.midint < 60){
      gd.td.midint = 60;
      }
   fprintf(stderr,"th_miname_dump(): sleep time =%d, return  %d = miname_dump(void);\n",
     gd.td.midint, miname_dump(gd.fi.midump_filename_2));
   pthread_mutex_unlock(&name_mutex);
   sleep(gd.td.midint);
   }

return 0;
}





