signal
& threadspthread_create()
call.
Already installed handlers remain active;
child threads inherit handlers.
Contrarily to threads, new processes reset the signal handlers
to SIG_DFL
, whose meaning
is explained in the signal(3)
(LynxOS) or
signal(7)
(Linux) manual.
argc
/argv[]
and
return
/exit()
from the plain unthreaded world),
you either read and understood K&R completely and know its contents
by heart or are wondering how to
deal correctly the void*
pointer.
In principle, you can cast as cast can and just get along,
but that would remove some of the implicite compiler checkings.
The recommended way is to use casts where needed and leave the basic
consistency checks to compiler and carefully designed header files like
/usr/include/pthread.h
.
|
typedef
is not necessary, but indicates that any more complicated parameter set,
including struct
can be used instead.
NB:
Take care that the caller survives the end of the thread,
or make the parameters static
,
because they are transferred (forth and back) by reference!
The alternative (and otherwise equivalent) way of returning parameters
by return
instead of pthread_exit()
is deprecated.
The pthread_exit()
performs for example cleanup functions,
which may have been defined by pthread_cleanup_push
calls.