Overview
| Artifact ID: | 9585e731b4756f342395f34f03fc62fdea5e0539 |
|---|---|
| Ticket: | 992108ffffffffffffffffffffffffffffffffff
TclFinalizeLock on Unix not correct. |
| User & Date: | vasiljevic on 2004-07-20 16:55:48 |
Changes
- icomment:
Logged In: YES user_id=95086 To: "assume that all threads are destroyed" is not that easy. Who is assuming that all threads are destroyed? You can very easily have apps using Tcl API which do create threads using Tcl_CreateThread and Tcl has no notion of those whatsoever. Therefore, assuming that all threads are destroyed at the Tcl_Finalize, except for the main thread is not always true. As far as I can see, destroying of initLock is troublesome and can lead (in certain circumstances) to problems. I think in this case we need to make a trade-off. Either the caller *never* calls Tcl_Finalize from two threads at the same time, or we accept a single mutex leak on FreeBSD. The way the Tcl_Finalize is now implemented would easily allow any number of threads to simultaneously call the Tcl_Finalize w/o stepping on each other toes. Forcefully deleting the initLock brings a significant limitation here. I would suggest, we can bring this topic to the Tcl core list and ask other people what do to in this case: either force Tcl_Finalize to really clean up *everything* risking potential cores or allowing one leaked mutex on FreeBsd implementation. I can't make this decision alone given the possible side-effects. - login: "vasiljevic"
- mimetype: "text/plain"
- username: "vasiljevic"