Changeset 4297


Ignore:
Timestamp:
Nov 13, 2012 8:46:42 AM (11 years ago)
Author:
bennylp
Message:

Re #1562: PJSUA-LIB shutdown operation may block for a long time if system time is modified while the shutdown is in progress. Also fixed similar issue in STUN client.

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util/stun_simple_client.c

    r4224 r4297  
    194194 
    195195        /* Calculate time of next retransmission. */ 
    196         pj_gettimeofday(&next_tx); 
     196        pj_gettickcount(&next_tx); 
    197197        next_tx.sec += (stun_timer[send_cnt]/1000); 
    198198        next_tx.msec += (stun_timer[send_cnt]%1000); 
    199199        pj_time_val_normalize(&next_tx); 
    200200 
    201         for (pj_gettimeofday(&now), select_rc=1;  
     201        for (pj_gettickcount(&now), select_rc=1; 
    202202             status==PJ_SUCCESS && select_rc>=1 && wait_resp>0  
    203203               && PJ_TIME_VAL_LT(now, next_tx);  
    204              pj_gettimeofday(&now))  
     204             pj_gettickcount(&now)) 
    205205        { 
    206206            pj_time_val timeout; 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c

    r4262 r4297  
    10761076    pj_time_val timeout, now; 
    10771077 
    1078     pj_gettimeofday(&timeout); 
     1078    pj_gettickcount(&timeout); 
    10791079    timeout.msec += msec; 
    10801080    pj_time_val_normalize(&timeout); 
     
    10851085        while (pjsua_handle_events(10) > 0 && i > 0) 
    10861086            --i; 
    1087         pj_gettimeofday(&now); 
     1087        pj_gettickcount(&now); 
    10881088    } while (PJ_TIME_VAL_LT(now, timeout)); 
    10891089} 
Note: See TracChangeset for help on using the changeset viewer.