Changeset 4281 for pjproject


Ignore:
Timestamp:
Oct 8, 2012 8:13:12 AM (12 years ago)
Author:
ming
Message:

Fixed #1592: Multithreading issues in PJSIP (fixing pj_timer_heap_poll() and lock order inversion in tcp/tls transport)

Location:
pjproject/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/timer.c

    r4154 r4281  
    513513    PJ_ASSERT_RETURN(ht, 0); 
    514514 
     515    lock_timer_heap(ht); 
    515516    if (!ht->cur_size && next_delay) { 
    516517        next_delay->sec = next_delay->msec = PJ_MAXINT32; 
     518        unlock_timer_heap(ht); 
    517519        return 0; 
    518520    } 
     
    521523    pj_gettickcount(&now); 
    522524 
    523     lock_timer_heap(ht); 
    524525    while ( ht->cur_size &&  
    525526            PJ_TIME_VAL_LTE(ht->heap[0]->_timer_value, now) && 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c

    r4262 r4281  
    690690                                    &size, 0); 
    691691        if (status != PJ_EPENDING) { 
     692            pj_lock_release(tcp->base.lock); 
    692693            on_data_sent(tcp->asock, op_key, size); 
     694            pj_lock_acquire(tcp->base.lock); 
    693695        } 
    694696 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c

    r4262 r4281  
    715715 
    716716        if (status != PJ_EPENDING) { 
     717            pj_lock_release(tls->base.lock); 
    717718            on_data_sent(tls->ssock, op_key, size); 
     719            pj_lock_acquire(tls->base.lock); 
    718720        } 
    719721    } 
Note: See TracChangeset for help on using the changeset viewer.