Diff

Differences From Artifact [65feda12d8]:

To Artifact [843bfcfd7e]:


  1473   1473   	appfs_tcl_ResetInterps();
  1474   1474   	appfs_get_path_info_cache_flush(-1, -1);
  1475   1475   
  1476   1476   	return;
  1477   1477   }
  1478   1478   
  1479   1479   /*
  1480         - * Signal handler to initiate a hot-restart
         1480  + * Terminate a thread and release resources
         1481  + */
         1482  +static void appfs_thread_exit(void) {
         1483  +	Tcl_Interp *interp;
         1484  +
         1485  +	pthread_exit(NULL);
         1486  +
         1487  +	interp = pthread_getspecific(interpKey);
         1488  +	if (interp != NULL) {
         1489  +		Tcl_DeleteInterp(interp);
         1490  +	}
         1491  +
         1492  +	return;
         1493  +}
         1494  +
         1495  +/*
         1496  + * Signal handler
         1497  + *         SIGHUP initiates a hot restart
         1498  + *         SIGUSR1 terminates the current thread
  1481   1499    */
  1482   1500   static void appfs_signal_handler(int sig) {
  1483   1501   	/* Do not handle signals until FUSE has been started */
  1484   1502   	if (!appfs_fuse_started) {
  1485   1503   		return;
  1486   1504   	}
  1487   1505   
         1506  +	/* Request to perform a "hot" restart */
  1488   1507   	if (sig == SIGHUP) {
  1489   1508   		appfs_hot_restart();
  1490   1509   	}
         1510  +
         1511  +	/* Request to terminate the current request/thread */
         1512  +	if (sig == SIGUSR1) {
         1513  +		appfs_thread_exit();
         1514  +	}
  1491   1515   
  1492   1516   	return;
  1493   1517   }
  1494   1518   
  1495   1519   /*
  1496   1520    * FUSE operations structure
  1497   1521    */