diff options
Diffstat (limited to 'Python/thread_lwp.h')
-rw-r--r-- | Python/thread_lwp.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Python/thread_lwp.h b/Python/thread_lwp.h index b28e602..ab59ccd 100644 --- a/Python/thread_lwp.h +++ b/Python/thread_lwp.h @@ -52,9 +52,7 @@ static void _init_thread _P0() int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) { thread_t tid; - int success = 0; /* init not needed when SOLARIS_THREADS and */ - /* C_THREADS implemented properly */ - + int success; dprintf(("start_new_thread called\n")); if (!initialized) init_thread(); @@ -62,6 +60,16 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) return success < 0 ? 0 : 1; } +long get_thread_ident _P0() +{ + thread_t tid; + if (!initialized) + init_thread(); + if (lwp_self(&tid) < 0) + return -1; + return tid.thread_id; +} + static void do_exit_thread _P1(no_cleanup, int no_cleanup) { dprintf(("exit_thread called\n")); |