Changeset 125 in libcf for trunk/src/cf_log.c


Ignore:
Timestamp:
06/12/13 13:44:25 (11 years ago)
Author:
cheese
Message:

#1 fix mutex bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cf_log.c

    r123 r125  
    5151    if (gLogArray.ctxPool[__mapid] == NULL) \
    5252        return CF_ERROR_LOG_NOT_MAPPED_ID
    53 
    54 #define LOCK_LOG_CTX(__ctx)             CF_Mutex_Lock (__ctx->mutex)
    55 #define UNLOCK_LOG_CTX(__ctx)           CF_Mutex_Unlock (__ctx->mutex)
    5653
    5754#define LOG_BUFFER_DEFAULT_SIZE         128 * 1024
     
    314311    ASSERT_CTX (ctx);
    315312
    316     LOCK_LOG_CTX (context);
     313    CF_Mutex_Lock (context->mutex);
    317314//  va_start (valist, fmt);
    318315
     
    324321
    325322//  va_end (valist);
    326     UNLOCK_LOG_CTX (context);
     323    CF_Mutex_Unlock (context->mutex);
    327324
    328325    return CF_OK;
     
    343340    ASSERT_CTX (ctx);
    344341
    345     LOCK_LOG_CTX (context);
     342    CF_Mutex_Lock (context->mutex);
    346343    CF_Log_Local_Flush (context);
    347     UNLOCK_LOG_CTX (context);
     344    CF_Mutex_Unlock (context->mutex);
    348345
    349346    return CF_OK;
Note: See TracChangeset for help on using the changeset viewer.