Check-in [65a6138eb6]
Overview
Comment:Updated to not continue to reset interpreters forever after a restart request
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:65a6138eb63feb3218475f6feaad8ae71ecb8cc2
User & Date: rkeene on 2014-11-11 17:48:05
Other Links: manifest | tags
Context
2014-11-11
18:38
Added a CPIO input mode for "appfs-mkfs" check-in: 5bdc276f57 user: rkeene tags: trunk
17:48
Updated to not continue to reset interpreters forever after a restart request check-in: 65a6138eb6 user: rkeene tags: trunk
17:43
Added support for hot-restart of AppFSd on SIGUP check-in: b6ea13d9c3 user: rkeene tags: trunk
Changes

Modified appfsd.c from [2fbbb1d1a2] to [65feda12d8].

   253    253   /*
   254    254    * Return the thread-specific Tcl interpreter, creating it if needed
   255    255    */
   256    256   static Tcl_Interp *appfs_TclInterp(void) {
   257    257   	Tcl_Interp *interp;
   258    258   	int pthread_ret;
   259    259   	static __thread int thread_interp_reset_key = 0;
          260  +	int global_interp_reset_key;
          261  +
          262  +	global_interp_reset_key = __sync_fetch_and_add(&interp_reset_key, 0);
   260    263   
   261    264   	interp = pthread_getspecific(interpKey);
   262         -	if (interp != NULL && thread_interp_reset_key != interp_reset_key) {
          265  +	if (interp != NULL && thread_interp_reset_key != global_interp_reset_key) {
   263    266   		APPFS_DEBUG("Terminating old interpreter and restarting due to reset request.");
   264    267   
   265    268   		Tcl_DeleteInterp(interp);
   266    269   
   267    270   		interp = NULL;
          271  +
          272  +		thread_interp_reset_key = global_interp_reset_key;
   268    273   	}
   269    274   
   270    275   	if (interp == NULL) {
   271    276   		interp = appfs_create_TclInterp(NULL);
   272    277   
   273    278   		if (interp == NULL) {
   274    279   			return(NULL);