Check-in [6eb9af02d5]
Overview
Comment:Added SIGUSR1 handling for terminating a thread
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6eb9af02d5c6ed9ec4fadfbdea298051778ffe25
User & Date: rkeene on 2014-11-11 19:10:46
Other Links: manifest | tags
Context
2014-11-12
05:09
Removed interruption support, there is no clean way to implement it check-in: 39025b67ed user: rkeene tags: trunk
2014-11-11
19:10
Added SIGUSR1 handling for terminating a thread check-in: 6eb9af02d5 user: rkeene tags: trunk
18:52
Added base64 module for PKI on Tcl 8.5 check-in: 4074828ffa user: rkeene tags: trunk
Changes

Modified appfsd.c from [65feda12d8] to [843bfcfd7e].

1473
1474
1475
1476
1477
1478
1479
















1480


1481
1482
1483
1484
1485
1486
1487

1488
1489
1490





1491
1492
1493
1494
1495
1496
1497
	appfs_tcl_ResetInterps();
	appfs_get_path_info_cache_flush(-1, -1);

	return;
}

/*
















 * Signal handler to initiate a hot-restart


 */
static void appfs_signal_handler(int sig) {
	/* Do not handle signals until FUSE has been started */
	if (!appfs_fuse_started) {
		return;
	}


	if (sig == SIGHUP) {
		appfs_hot_restart();
	}






	return;
}

/*
 * FUSE operations structure
 */







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>







>



>
>
>
>
>







1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
	appfs_tcl_ResetInterps();
	appfs_get_path_info_cache_flush(-1, -1);

	return;
}

/*
 * Terminate a thread and release resources
 */
static void appfs_thread_exit(void) {
	Tcl_Interp *interp;

	pthread_exit(NULL);

	interp = pthread_getspecific(interpKey);
	if (interp != NULL) {
		Tcl_DeleteInterp(interp);
	}

	return;
}

/*
 * Signal handler
 *         SIGHUP initiates a hot restart
 *         SIGUSR1 terminates the current thread
 */
static void appfs_signal_handler(int sig) {
	/* Do not handle signals until FUSE has been started */
	if (!appfs_fuse_started) {
		return;
	}

	/* Request to perform a "hot" restart */
	if (sig == SIGHUP) {
		appfs_hot_restart();
	}

	/* Request to terminate the current request/thread */
	if (sig == SIGUSR1) {
		appfs_thread_exit();
	}

	return;
}

/*
 * FUSE operations structure
 */