From 5931dc59c08af2cf1f23518f700e9107effa9e59 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 21 Nov 2007 14:12:01 +0000 Subject: Ticket #417: added pjlib API to retrieve the native thread handle from pj_thread_t git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1589 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/os_core_unix.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'pjlib/src/pj/os_core_unix.c') diff --git a/pjlib/src/pj/os_core_unix.c b/pjlib/src/pj/os_core_unix.c index e901036a..5a246df5 100644 --- a/pjlib/src/pj/os_core_unix.c +++ b/pjlib/src/pj/os_core_unix.c @@ -238,6 +238,20 @@ PJ_DEF(pj_bool_t) pj_thread_is_registered(void) #endif } +/* + * Get native thread handle + */ +PJ_DEF(void*) pj_thread_get_os_handle(pj_thread_t *thread) +{ + PJ_ASSERT_RETURN(thread, NULL); + +#if PJ_HAS_THREADS + return &thread->thread; +#else + pj_assert("pj_thread_is_registered() called in non-threading mode!"); + return NULL; +#endif +} /* * pj_thread_register(..) -- cgit v1.2.3