Changeset 125 in libcf
- Timestamp:
- 06/12/13 13:44:25 (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cf_debug.c
r124 r125 391 391 ASSERT_CTX (ctx); 392 392 393 CF_Mutex_Lock ( &ctx->mutex);393 CF_Mutex_Lock (ctx->mutex); 394 394 CF_Debug_CallStackPush (gDebugSingleCtx, file, func, line); 395 CF_Mutex_Unlock ( &ctx->mutex);395 CF_Mutex_Unlock (ctx->mutex); 396 396 397 397 return CF_OK; … … 412 412 ASSERT_CTX (ctx); 413 413 414 CF_Mutex_Lock ( &ctx->mutex);414 CF_Mutex_Lock (ctx->mutex); 415 415 CF_Debug_CallStackPop (gDebugSingleCtx, NULL); 416 CF_Mutex_Unlock ( &ctx->mutex);416 CF_Mutex_Unlock (ctx->mutex); 417 417 418 418 return CF_OK; -
trunk/src/cf_log.c
r123 r125 51 51 if (gLogArray.ctxPool[__mapid] == NULL) \ 52 52 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)56 53 57 54 #define LOG_BUFFER_DEFAULT_SIZE 128 * 1024 … … 314 311 ASSERT_CTX (ctx); 315 312 316 LOCK_LOG_CTX (context);313 CF_Mutex_Lock (context->mutex); 317 314 // va_start (valist, fmt); 318 315 … … 324 321 325 322 // va_end (valist); 326 UNLOCK_LOG_CTX (context);323 CF_Mutex_Unlock (context->mutex); 327 324 328 325 return CF_OK; … … 343 340 ASSERT_CTX (ctx); 344 341 345 LOCK_LOG_CTX (context);342 CF_Mutex_Lock (context->mutex); 346 343 CF_Log_Local_Flush (context); 347 UNLOCK_LOG_CTX (context);344 CF_Mutex_Unlock (context->mutex); 348 345 349 346 return CF_OK; -
trunk/test/log.c
r122 r125 19 19 int th = 0; 20 20 21 if (CF_Mutex_Lock ( &globalMutex) < 0) { // for critical section21 if (CF_Mutex_Lock (globalMutex) < 0) { // for critical section 22 22 // error 23 23 } 24 24 th = cnt++; 25 if (CF_Mutex_Unlock ( &globalMutex) < 0) { // for critical section25 if (CF_Mutex_Unlock (globalMutex) < 0) { // for critical section 26 26 // error 27 27 } -
trunk/test/thread.c
r122 r125 10 10 11 11 int worker (void * arg) { 12 if (CF_Mutex_Lock ( &globalMutex) < 0) { // for critical section12 if (CF_Mutex_Lock (globalMutex) < 0) { // for critical section 13 13 // error 14 14 } … … 16 16 fprintf (stderr, "here is critical section !\n"); 17 17 18 if (CF_Mutex_Unlock ( &globalMutex) < 0) { // for critical section18 if (CF_Mutex_Unlock (globalMutex) < 0) { // for critical section 19 19 // error 20 20 }
Note:
See TracChangeset
for help on using the changeset viewer.