diff options
Diffstat (limited to 'unix/tclUnixThrd.c')
-rw-r--r-- | unix/tclUnixThrd.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index ad36242..04d736b 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -317,6 +317,36 @@ Tcl_GetCurrentThread(void) /* *---------------------------------------------------------------------- * + * TclpResetLocks + * + * This procedure is used to forcibly reset all the "one time" locks + * used by the other platform-specific locking procedures. Currently, + * this procedure is only called from the notifier to handle fork() + * and must not be called from anywhere else. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +TclpResetLocks(void) +{ +#ifdef TCL_THREADS + pthread_mutex_t dummyLock = PTHREAD_MUTEX_INITIALIZER; + memcpy((void *)&masterLock, (void *)&dummyLock, sizeof(pthread_mutex_t)); + memcpy((void *)&initLock, (void *)&dummyLock, sizeof(pthread_mutex_t)); + memcpy((void *)&allocLock, (void *)&dummyLock, sizeof(pthread_mutex_t)); +#endif +} + +/* + *---------------------------------------------------------------------- + * * TclpInitLock * * This procedure is used to grab a lock that serializes initialization |