Changeset 109 in libcf for trunk/src/cf_log.c
- Timestamp:
- 06/04/13 14:25:10 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cf_log.c
r108 r109 57 57 #define LOG_DATETIME_LENGTH sizeof ("0000-00-00 00:00:00.000") - 1 58 58 59 /** 60 * 로그 컨텍스트 61 * 62 * @remark change from public to private 63 */ 59 /** 로그 컨텍스트 (Opaque) */ 64 60 typedef void * CF_Log_Ctx; 65 61 … … 75 71 int sec; 76 72 int usec; 77 } S_CF_LOG_DATETIME, CF_LOG_DATETIME; 78 73 } CF_LOG_DATETIME; 74 75 /** 로그 컨텍스트 (CF_Log_Ctx의 구현) */ 79 76 typedef struct __cf_log_ctx__ { 80 char path[NAME_LENGTH + 1];81 int fd;82 char * buffer;83 size_t size; /* entire size of buffer */84 size_t length; /* data length in current */85 CF_Mutex mutex;86 } S_CF_LOG_CTX,CF_LOG_CTX;77 char path[NAME_LENGTH + 1]; 78 int fd; 79 char * buffer; 80 size_t size; /* entire size of buffer */ 81 size_t length; /* data length in current */ 82 CF_Mutex_Ctx mutex; 83 } CF_LOG_CTX; 87 84 88 85 typedef struct __cf_log_array__ { 89 86 CF_Log_Ctx * ctxPool; 90 87 int ctxSize; 91 } S_CF_LOG_ARRAY,CF_LOG_ARRAY;88 } CF_LOG_ARRAY; 92 89 93 90 static CF_LOG_ARRAY gLogArray; … … 257 254 ASSERT_CTX (ctx); 258 255 259 if (CF_Mutex_Create (&context->mutex) < 0)256 if (CF_Mutex_CreateCtx (&context->mutex) < 0) 260 257 return CF_ERROR_LOG_SET_MULTITHREAD; 261 258 … … 279 276 ASSERT_CTX (ctx); 280 277 281 if (CF_Mutex_Destory (&context->mutex) < 0)278 if (CF_Mutex_DestoryCtx (&context->mutex) < 0) 282 279 return CF_ERROR_LOG_UNSET_MULTITHREAD; 283 280 … … 371 368 CF_File_Close (context->fd); 372 369 373 CF_Mutex_Destory (&context->mutex);370 CF_Mutex_DestoryCtx (&context->mutex); 374 371 context->mutex = NULL; 375 372 … … 409 406 if (context == NULL) 410 407 { 411 result = CF_ERROR_LOG_ ALLOCATE_CTX;408 result = CF_ERROR_LOG_CREATE_CTX; 412 409 TRY_BREAK; 413 410 }
Note:
See TracChangeset
for help on using the changeset viewer.