I'm currently involved in multithreaded development tasks on
Solaris 2.6 and trying to make sense of the MT attributes for
Especially, I'm wondering wether 'time' can be called safely
in a multithreaded app.
On the manpage of 'time' I read
| ATTRIBUTE TYPE| ATTRIBUTE VALUE |
| MT-Level | Async-Signal-Safe|
and for async-safety attributes(5) tells me
Async-Signal-Safe refers to particular library
routines that can be safely called from a signal
handler. A thread that is executing an Async-
Signal-Safe routine will not deadlock with
itself if interrupted by a signal. Signals are
only a problem for MT-Safe routines that acquire
Signals are disabled when locks are acquired in
Async-Signal-Safe routines. This prevents a
signal handler that might acquire the same lock
from being called.
Now, this description tells me that a thread calling
'time' won't deadlock in the call when interrupted
and that signals are disabled in 'time' whenever it
It doesn't tell me wether any data can be corrupted
on reentering the call (i.e. is it 'Safe' ?) or wether
concurrency is provided (i.e. is it 'MT-Safe' ?).
Can anybody shed some light on this topic ?
Thanks a lot