4549dfa713a102b2ac116659a9d20124a6a9d84e
galt
  Thu Jul 11 10:47:45 2013 -0700
After discussing with Angie, its probably OK to allow atexit cleanup
diff --git src/lib/errabort.c src/lib/errabort.c
index 0238aa5..46ddb3b 100644
--- src/lib/errabort.c
+++ src/lib/errabort.c
@@ -306,31 +306,31 @@
 // Use a boolean since there is no known unused value for pthread_t variable. NULL and -1 are not portable.
 static boolean pidInUseValid = FALSE;  // tells when pidInUse contains a valid pid that can be compared.
 static pthread_t pidInUse; // there is no "unused" value to which we can initialize this.
 static pthread_mutex_t pidInUseMutex = PTHREAD_MUTEX_INITIALIZER;
 pthread_mutex_lock( &pidInUseMutex );
 // If this pid equals pidInUse, then this function has been re-entered due to severe out-of-memory error.
 // But we only compare them when pidInUseValid is TRUE.
 if (pidInUseValid && pthread_equal(pid, pidInUse)) 
     {
     // Avoid deadlock on self by exiting immediately.
     // Use pthread_equal because directly comparing two pthread_t vars is not allowed.
     // This re-entrancy only happens when it has aborted already due to out of memory
     // which should be a rare occurrence.
     char *errMsg = "errAbort re-entered due to out-of-memory condition. Exiting.\n";
     write(STDERR_FILENO, errMsg, strlen(errMsg)); 
-    _exit(1);   // out of memory is a serious problem, exit immediately without running atexit cleanup.
+    exit(1);   // out of memory is a serious problem, exit immediately, but allow atexit cleanup.
     }
 pthread_mutex_unlock( &pidInUseMutex );
 
 // This is the main mutex we really care about.
 // It controls access to the hash where thread-specific data is stored.
 static pthread_mutex_t ptavMutex = PTHREAD_MUTEX_INITIALIZER;
 pthread_mutex_lock( &ptavMutex );
 
 // safely tell threads that pidInUse
 // is valid and correctly set and may be compared to pid
 pthread_mutex_lock( &pidInUseMutex );
 pidInUse = pthread_self();  // setting it directly to pid is not allowed.
 pidInUseValid = TRUE;
 pthread_mutex_unlock( &pidInUseMutex );