6 PyThread__init_thread(void)
14 PyThread_start_new_thread(void (*func
)(void *), void *arg
)
16 int success
= 0; /* init not needed when SOLARIS_THREADS and */
17 /* C_THREADS implemented properly */
19 dprintf(("PyThread_start_new_thread called\n"));
21 PyThread_init_thread();
22 return success
< 0 ? 0 : 1;
26 PyThread_get_thread_ident(void)
29 PyThread_init_thread();
33 void do_PyThread_exit_thread(int no_cleanup
)
35 dprintf(("PyThread_exit_thread called\n"));
44 PyThread_exit_thread(void)
46 do_PyThread_exit_thread(0);
50 PyThread__exit_thread(void)
52 do_PyThread_exit_thread(1);
57 void do_PyThread_exit_prog(int status
, int no_cleanup
)
59 dprintf(("PyThread_exit_prog(%d) called\n", status
));
68 PyThread_exit_prog(int status
)
70 do_PyThread_exit_prog(status
, 0);
74 PyThread__exit_prog(int status
)
76 do_PyThread_exit_prog(status
, 1);
78 #endif /* NO_EXIT_PROG */
84 PyThread_allocate_lock(void)
87 dprintf(("PyThread_allocate_lock called\n"));
89 PyThread_init_thread();
91 dprintf(("PyThread_allocate_lock() -> %p\n", lock
));
92 return (PyThread_type_lock
) lock
;
96 PyThread_free_lock(PyThread_type_lock lock
)
98 dprintf(("PyThread_free_lock(%p) called\n", lock
));
102 PyThread_acquire_lock(PyThread_type_lock lock
, int waitflag
)
106 dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock
, waitflag
));
107 dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock
, waitflag
, success
));
112 PyThread_release_lock(PyThread_type_lock lock
)
114 dprintf(("PyThread_release_lock(%p) called\n", lock
));
121 PyThread_allocate_sema(int value
)
123 dprintf(("PyThread_allocate_sema called\n"));
125 PyThread_init_thread();
127 dprintf(("PyThread_allocate_sema() -> %p\n", sema
));
128 return (PyThread_type_sema
) sema
;
132 PyThread_free_sema(PyThread_type_sema sema
)
134 dprintf(("PyThread_free_sema(%p) called\n", sema
));
138 PyThread_down_sema(PyThread_type_sema sema
, int waitflag
)
140 dprintf(("PyThread_down_sema(%p, %d) called\n", sema
, waitflag
));
141 dprintf(("PyThread_down_sema(%p) return\n", sema
));
146 PyThread_up_sema(PyThread_type_sema sema
)
148 dprintf(("PyThread_up_sema(%p)\n", sema
));