Ignore:
Timestamp:
Mar 26, 2018 10:33:50 AM (20 months ago)
Author:
nanang
Message:

Close #2101:

  • set atomic's mutex to NULL in atomic destroy
  • added few sanity checks to the atomic functions.
File:
1 edited

Legend:

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

    r5539 r5758  
    751751{ 
    752752    PJ_CHECK_STACK(); 
     753    PJ_ASSERT_ON_FAIL(atomic_var, return); 
    753754 
    754755    InterlockedExchange(&atomic_var->value, value); 
     
    785786PJ_DEF(void) pj_atomic_inc(pj_atomic_t *atomic_var) 
    786787{ 
     788    PJ_ASSERT_ON_FAIL(atomic_var, return); 
    787789    pj_atomic_inc_and_get(atomic_var); 
    788790} 
     
    807809PJ_DEF(void) pj_atomic_dec(pj_atomic_t *atomic_var) 
    808810{ 
     811    PJ_ASSERT_ON_FAIL(atomic_var, return); 
    809812    pj_atomic_dec_and_get(atomic_var); 
    810813} 
     
    816819                            pj_atomic_value_t value ) 
    817820{ 
     821    PJ_ASSERT_ON_FAIL(atomic_var, return); 
    818822#if defined(PJ_WIN32_WINNT) && PJ_WIN32_WINNT >= 0x0400 
    819823    InterlockedExchangeAdd( &atomic_var->value, value ); 
Note: See TracChangeset for help on using the changeset viewer.