Changeset 142 in libcf for trunk/src/cf_mutex.c


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

#1 modify docs and some handle closing routine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.