diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-11-21 14:12:01 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-11-21 14:12:01 +0000 |
commit | 5931dc59c08af2cf1f23518f700e9107effa9e59 (patch) | |
tree | 82f144feae2c2eb35b1f65f9edc156365152e347 /pjmedia/src | |
parent | 7cea28ab2a2d6dadb0ef3aaa6a3194e45f98cba5 (diff) |
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
Diffstat (limited to 'pjmedia/src')
-rw-r--r-- | pjmedia/src/pjmedia/endpoint.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pjmedia/src/pjmedia/endpoint.c b/pjmedia/src/pjmedia/endpoint.c index d9296f1c..dbeefe7f 100644 --- a/pjmedia/src/pjmedia/endpoint.c +++ b/pjmedia/src/pjmedia/endpoint.c @@ -226,6 +226,28 @@ PJ_DEF(pj_ioqueue_t*) pjmedia_endpt_get_ioqueue(pjmedia_endpt *endpt) return endpt->ioqueue; } +/** + * Get the number of worker threads in media endpoint. + */ +PJ_DEF(unsigned) pjmedia_endpt_get_thread_count(pjmedia_endpt *endpt) +{ + PJ_ASSERT_RETURN(endpt, 0); + return endpt->thread_cnt; +} + +/** + * Get a reference to one of the worker threads of the media endpoint + */ +PJ_DEF(pj_thread_t*) pjmedia_endpt_get_thread(pjmedia_endpt *endpt, + unsigned index) +{ + PJ_ASSERT_RETURN(endpt, NULL); + PJ_ASSERT_RETURN(index < endpt->thread_cnt, NULL); + + /* here should be an assert on index >= 0 < endpt->thread_cnt */ + + return endpt->thread[index]; +} /** * Worker thread proc. |