Ignore:
Timestamp:
Feb 21, 2013 11:18:36 AM (11 years ago)
Author:
bennylp
Message:

Fixed #1616: Implementation of Group lock and other foundation in PJLIB for fixing synchronization issues

File:
1 edited

Legend:

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

    r3553 r4359  
    263263        key = PJ_POOL_ALLOC_T(pool, pj_ioqueue_key_t); 
    264264        key->ref_count = 0; 
    265         rc = pj_mutex_create_recursive(pool, NULL, &key->mutex); 
     265        rc = pj_lock_create_recursive_mutex(pool, NULL, &key->lock); 
    266266        if (rc != PJ_SUCCESS) { 
    267267            key = ioqueue->free_list.next; 
    268268            while (key != &ioqueue->free_list) { 
    269                 pj_mutex_destroy(key->mutex); 
     269                pj_lock_destroy(key->lock); 
    270270                key = key->next; 
    271271            } 
     
    324324    key = ioqueue->active_list.next; 
    325325    while (key != &ioqueue->active_list) { 
    326         pj_mutex_destroy(key->mutex); 
     326        pj_lock_destroy(key->lock); 
    327327        key = key->next; 
    328328    } 
     
    330330    key = ioqueue->closing_list.next; 
    331331    while (key != &ioqueue->closing_list) { 
    332         pj_mutex_destroy(key->mutex); 
     332        pj_lock_destroy(key->lock); 
    333333        key = key->next; 
    334334    } 
     
    336336    key = ioqueue->free_list.next; 
    337337    while (key != &ioqueue->free_list) { 
    338         pj_mutex_destroy(key->mutex); 
     338        pj_lock_destroy(key->lock); 
    339339        key = key->next; 
    340340    } 
     
    423423    if (status < 0) { 
    424424        rc = pj_get_os_error(); 
    425         pj_mutex_destroy(key->mutex); 
     425        pj_lock_destroy(key->lock); 
    426426        key = NULL; 
    427427        TRACE_((THIS_FILE,  
     
    498498     * deadlock. 
    499499     */ 
    500     pj_mutex_lock(key->mutex); 
     500    pj_lock_acquire(key->lock); 
    501501 
    502502    /* Also lock ioqueue */ 
     
    532532 
    533533    /* Done. */ 
    534     pj_mutex_unlock(key->mutex); 
     534    pj_lock_release(key->lock); 
    535535#else 
    536     pj_mutex_destroy(key->mutex); 
     536    pj_lock_destroy(key->lock); 
    537537#endif 
    538538 
Note: See TracChangeset for help on using the changeset viewer.