Changeset 3328 for pjproject/trunk


Ignore:
Timestamp:
Sep 30, 2010 11:38:20 PM (14 years ago)
Author:
bennylp
Message:

Closed #1121 (Deadlock in transaction code when hanging up calls): fixed the race condition when setting up transaction timeout

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_transaction.c

    r3311 r3328  
    15931593    lock_timer(tsx); 
    15941594 
    1595     /* Transaction must not have got final response */ 
    1596     PJ_ASSERT_ON_FAIL(tsx->status_code < 200, 
    1597                     { unlock_timer(tsx); return PJ_EINVALIDOP; }); 
     1595    /* Transaction should normally not have final response, but as 
     1596     * #1121 says there is a (tolerable) window of race condition 
     1597     * where this might happen. 
     1598     */ 
     1599    if (tsx->status_code >= 200 && tsx->timeout_timer.id != 0) { 
     1600        /* Timeout is already set */ 
     1601        unlock_timer(tsx); 
     1602        return PJ_EEXISTS; 
     1603    } 
    15981604 
    15991605    if (tsx->timeout_timer.id != 0) { 
Note: See TracChangeset for help on using the changeset viewer.