Ignore:
Timestamp:
Oct 31, 2007 7:58:30 AM (17 years ago)
Author:
bennylp
Message:

Fixed deadlock in increment_counter() and decrement_counter() caused by different lock order (thanks Phil Torre)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/pjproject-0.5-stable/pjlib/src/pj/ioqueue_select.c

    r1441 r1532  
    409409static void decrement_counter(pj_ioqueue_key_t *key) 
    410410{ 
     411    pj_lock_acquire(key->ioqueue->lock); 
    411412    pj_mutex_lock(key->ioqueue->ref_cnt_mutex); 
    412413    --key->ref_count; 
     
    418419        pj_time_val_normalize(&key->free_time); 
    419420 
    420         pj_lock_acquire(key->ioqueue->lock); 
    421421        pj_list_erase(key); 
    422422        pj_list_push_back(&key->ioqueue->closing_list, key); 
    423423        /* Rescan fdset to get max descriptor */ 
    424424        rescan_fdset(key->ioqueue); 
    425         pj_lock_release(key->ioqueue->lock); 
    426425    } 
    427426    pj_mutex_unlock(key->ioqueue->ref_cnt_mutex); 
     427    pj_lock_release(key->ioqueue->lock); 
    428428} 
    429429#endif 
Note: See TracChangeset for help on using the changeset viewer.