Ignore:
Timestamp:
Nov 21, 2007 2:12:01 PM (16 years ago)
Author:
bennylp
Message:

Ticket #417: added pjlib API to retrieve the native thread handle from pj_thread_t

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/endpoint.c

    r1417 r1589  
    227227} 
    228228 
     229/** 
     230 * Get the number of worker threads in media endpoint. 
     231 */ 
     232PJ_DEF(unsigned) pjmedia_endpt_get_thread_count(pjmedia_endpt *endpt) 
     233{ 
     234    PJ_ASSERT_RETURN(endpt, 0); 
     235    return endpt->thread_cnt; 
     236} 
     237 
     238/** 
     239 * Get a reference to one of the worker threads of the media endpoint  
     240 */ 
     241PJ_DEF(pj_thread_t*) pjmedia_endpt_get_thread(pjmedia_endpt *endpt,  
     242                                              unsigned index) 
     243{ 
     244    PJ_ASSERT_RETURN(endpt, NULL); 
     245    PJ_ASSERT_RETURN(index < endpt->thread_cnt, NULL); 
     246 
     247    /* here should be an assert on index >= 0 < endpt->thread_cnt */ 
     248 
     249    return endpt->thread[index]; 
     250} 
    229251 
    230252/** 
Note: See TracChangeset for help on using the changeset viewer.