Hal Murray <[email protected]>:
> man 7 signal has a long list of what you can do in a signal handler.  (all 
> other system calls are unsafe)
> 
> Is there something similar that applies to killing threads?  If so, where is 
> it documented?
> 
> For example, if I kill a thread that is in the middle of malloc, are things 
> guaranteed to work correctly or can some global state be left in a broken 
> condition.  (or a lock locked, or ...)

It varies.  Some library calls are documented to be thread-safe.  The glibc
version of malloc is; some older versions were not.  In general, if it's
not documented thread-safe you need to wrap your own mutex around it.
-- 
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>
_______________________________________________
devel mailing list
[email protected]
http://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to