Changeset 142 in libcf


Ignore:
Timestamp:
07/19/13 10:46:16 (11 years ago)
Author:
cheese
Message:

#1 modify docs and some handle closing routine

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cf_debug.c

    r136 r142  
    281281 *
    282282 * \param ctx 디버그 컨텍스트
    283  *
    284  * \see CF_DEBUG_DESTROY_CTX
    285283 */
    286284static int
     
    306304 *
    307305 * \return 성공 시, CF_Debug_Ctx 형태의 컨텍스트; 실패 시, NULL
    308  * \see CF_DEBUG_CREATE_CTX
     306 *
     307 * \param ctx 디버그 컨텍스트
    309308 */
    310309static int
     
    343342 *
    344343 * \return 성공 시, CF_OK; 실패 시, 오류 코드
    345  *
    346  * \see CF_Debug_Finalize
    347344 */
    348345int
     
    380377 * \param func  함수 이름
    381378 * \param line  라인 넘버
    382  *
    383  * \see CF_Debug_LeaveFunction
    384379 */
    385380int
     
    403398 *
    404399 * \return 성공 시, CF_OK; 실패 시, 오류 코드
    405  *
    406  * \see CF_Debug_EnterFunction
    407400 */
    408401int
  • trunk/src/cf_log.c

    r137 r142  
    246246 *
    247247 * \param ctx 로그 컨텍스트
    248  *
    249  * \see CF_Log_UnsetMultiThread
    250248 */
    251249static int
     
    268266 *
    269267 * \param ctx 로그 컨텍스트
    270  *
    271  * \see CF_Log_SetMultiThread
    272268 */
    273269static int
     
    474470 *
    475471 * \remarks 반드시 먼저 초기화 해야하며, 초기화 시에 주어진 번호보다 작은 아이디 넘버를 사용
    476  *
    477  * \see CF_LOG_OPEN, CF_Log_CreateCtx
    478472 */
    479473static int
     
    498492 *
    499493 * \remarks 아이디 넘버에 해당하는 컨텍스트가 해제되므로 주의
    500  *
    501  * \see CF_LOG_CLOSE, CF_Log_DestroyCtx
    502494 */
    503495static int
  • trunk/src/cf_mutex.c

    r128 r142  
    2929    MUTEX_TYPE  mid;
    3030} CF_MUTEX_CTX;
    31 
    32 static int
    33 CF_Mutex_Local_Close (MUTEX_TYPE mid)
    34 {
    35 #if defined(_WIN32) || defined(_WIN64)
    36     if (mid == NULL)
    37         return CF_ERROR_MUTEX_INVALID_ARGS;
    38 
    39     CloseHandle (mid);
    40 #else
    41     pthread_mutex_destroy (&mid);
    42 #endif
    43 
    44     return CF_OK;
    45 }
    4631
    4732/**
     
    10590    ASSERT_MUTEX_CTX (ctx);
    10691
    107     CF_Mutex_Local_Close (context->mid);
     92#if defined(_WIN32) || defined(_WIN64)
     93    if (context->mid == NULL)
     94        return CF_ERROR_MUTEX_INVALID_ARGS;
     95
     96    CloseHandle (context->mid);
     97#else
     98    pthread_mutex_destroy (&context->mid);
     99#endif
     100
    108101    free (context);
    109102
  • trunk/src/cf_socket.c

    r128 r142  
    484484 *
    485485 * \param sock  서버 소켓
    486  *
    487  * \see CF_Socket_HostInfo
    488486 */
    489487int
  • trunk/src/cf_thread.c

    r128 r142  
    1515# include <process.h>
    1616# define THREAD_TYPE    HANDLE
    17 # define MUTEX_TYPE     HANDLE
    1817# define THREAD_RETURN  unsigned long   /**< 스레드 워커 함수 반환 형 */
    1918# define THREAD_CALL    __stdcall
     
    2120# include <pthread.h>
    2221# define THREAD_TYPE    pthread_t
    23 # define MUTEX_TYPE     pthread_mutex_t
    2422# define THREAD_RETURN  void *          /**< 스레드 워커 함수 반환 형 */
    2523# define THREAD_CALL
     
    3836    void            * arg;
    3937} CF_THREAD_CTX;
    40 
    41 static int
    42 CF_Thread_Local_Close (THREAD_TYPE tid)
    43 {
    44 #if defined(_WIN32) || defined(_WIN64)
    45     if (tid == NULL)
    46         return CF_ERROR_THREAD_INVALID_ARGS;
    47 
    48     CloseHandle (tid);
    49 #endif
    50 
    51     return CF_OK;
    52 }
    5338
    5439/**
     
    159144    ASSERT_THREAD_CTX (ctx);
    160145
    161     CF_Thread_Local_Close (context->tid);
     146#if defined(_WIN32) || defined(_WIN64)
     147    if (context->tid == NULL)
     148        return CF_ERROR_THREAD_INVALID_ARGS;
     149
     150    CloseHandle (context->tid);
     151#endif
    162152    free (context);
    163153
Note: See TracChangeset for help on using the changeset viewer.