Overview
| Artifact ID: | 29339bf68e2ffdc47c4e1a90a043bcd015f2c2a9 |
|---|---|
| Ticket: | 992108ffffffffffffffffffffffffffffffffff
TclFinalizeLock on Unix not correct. |
| User & Date: | mistachkin on 2004-07-16 03:52:25 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- comment changed to:
The function currently reads: void TclFinalizeLock () { #ifdef TCL_THREADS /* * You do not need to destroy mutexes that were created with the * PTHREAD_MUTEX_INITIALIZER macro. These mutexes do not need * any destruction: masterLock, allocLock, and initLock. */ pthread_mutex_unlock(&initLock); #endif } I believe that both the comment and the code are incorrect. Mutexes created with the pthread library have memory associated with them internally when you call pthread_mutex_create, therefore, pthread_mutex_destroy must be called on them. In my opinion, the function should be more like this: TclFinalizeLock () { #ifdef TCL_THREADS /* * These mutexes need to be destroyed via pthread_mutex_destroy * because they were created with pthread_mutex_create, which * internally allocates memory on some platforms. */ pthread_mutex_destroy(&allocLock); pthread_mutex_destroy(&masterLock); pthread_mutex_unlock(&initLock); pthread_mutex_destroy(&initLock); #endif } - foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "mistachkin"
- subsystem changed to: "49. Threading"
- title changed to: "TclpFinalizeLock on Unix not correct."
- type changed to: "Bug"