Changes between Version 2 and Version 4 of Ticket #1837


Ignore:
Timestamp:
May 8, 2015 2:57:06 AM (10 years ago)
Author:
ming
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1837 – Description

    v2 v4  
    1 This problem may cause crash such as: 
     1There may be some compatibility problems between dispatch queue and PJLIB functions. In particular, according to the [https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/dispatch_queue_create.3.html documentation]): 
     2 
     3{{{ 
     4The following interfaces MUST NOT be called by blocks submitted to a dispatch queue: 
     5           •   pthread_cancel(): 
     6           •   pthread_detach() 
     7           •   pthread_join() 
     8           •   pthread_kill() 
     9           •   pthread_exit() 
     10 
     11While the result of pthread_self() may change between invocations of blocks, the value 
     12will not change during the execution of any single block. Because the underlying 
     13thread may change beteween block invocations on a single queue, using per-thread 
     14data as an out-of-band return value is error prone. In other words, the result of 
     15calling pthread_setspecific() and pthread_getspecific() is well defined within 
     16a single block, but not across multiple blocks. 
     17}}} 
     18 
     19In iOS capture device, calling pj_thread_register() (which relies on pthread_get/setspecific()) inside a dispatch queue may cause crash such as: 
    220{{{ 
    321#0      0x00056c64 in tee_put_frame at pjmedia/pjmedia/vid_tee.c:360