1iv_thread(3)              ivykis programmer's manual              iv_thread(3)
2
3
4

NAME

6       iv_thread_create, iv_thread_set_debug_state - ivykis thread convenience
7       functions
8

SYNOPSIS

10       #include <iv_thread.h>
11
12       int iv_thread_create(const char *name, void  (*start_routine)(void  *),
13       void *arg);
14       void iv_thread_set_debug_state(int state);
15

DESCRIPTION

17       iv_thread_create is a wrapper around pthread_create(3) which will main‐
18       tain an ivykis main loop reference in the calling thread (which must be
19       an ivykis(3) thread, i.e. have had iv_init(3) called in it) for as long
20       as the created thread is alive.
21
22       Maintaining a reference on the calling thread's ivykis event loop makes
23       sure  that the calling thread will not return from its ivykis main loop
24       before the created thread exits, as that could cause cleanup still hap‐
25       pening  in the created thread to be interrupted when the calling thread
26       subsequently calls exit(3).
27
28       The created thread need not be an ivykis thread.
29
30       Enabling debugging by calling iv_thread_set_debug with a nonzero  argu‐
31       ment  will print a debug message to standard error whenever a thread is
32       created via iv_thread_create, whenever a thread so created  terminates,
33       and whenever destruction of such a thread is signaled back to the call‐
34       ing thread.
35
36       For inter-thread signaling, iv_thread uses iv_event(3).
37

SEE ALSO

39       ivykis(3), iv_event(3), exit(3), pthread_create(3)
40
41
42
43ivykis                            2010-09-13                      iv_thread(3)
Impressum