On Mon, Aug 3, 2015 at 6:34 PM, Gustaf Neumann <neum...@wu.ac.at> wrote:
> pthread_atfork() is called only once per process, its callbacks cannot> be unregistered.>
That's a sad under-design on libpthread's part, ain't it ? ;-)
But the Tcl library, among other things, somehow ambitions to be a "better
libc" (at least at times).
So, what about fixing that wart:
- call once and for all early in Tcl's init (like T_FE)
pthread_atfork(TclAtforkHandler)
- let TclAtForkHandler be:
lock(&atfmutex);
for(p=atflist;p;p=p->next) p();
unlock(&atfmutex);
- of course a couple of convenience routine would allow to add/remove
callbacks to atflist any time, in a thread-safe way thanks to atfmutex
-Alex
------------------------------------------------------------------------------
_______________________________________________
Tcl-Core mailing list
Tcl-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcl-core