Changeset 123 in libcf for trunk/src/cf_thread.c


Ignore:
Timestamp:
06/12/13 13:28:21 (11 years ago)
Author:
cheese
Message:

#1 fix windows bug for r122

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cf_thread.c

    r122 r123  
    5252{
    5353#if defined(_WIN32) || defined(_WIN64)
     54    if (tid == NULL)
     55        return CF_ERROR_THREAD_INVALID_ARGS;
     56
    5457    CloseHandle (tid);
    5558#endif
     
    6265{
    6366#if defined(_WIN32) || defined(_WIN64)
     67    if (mid == NULL)
     68        return CF_ERROR_MUTEX_INVALID_ARGS;
     69
    6470    CloseHandle (mid);
    6571#else
     
    230236#if defined(_WIN32) || defined(_WIN64)
    231237        context->mid = CreateMutexA (NULL, FALSE, NULL);
    232         if (*ctx == NULL)
     238        if (context->mid == NULL)
    233239        {
    234240            result = CF_ERROR_MUTEX_CREATE;
     
    243249        }
    244250#endif
     251
     252        *ctx = context;
    245253    }
    246254    CATCH_IF (result < 0)
    247255    {
    248         CF_Mutex_DestoryCtx (ctx);
     256        CF_Mutex_DestoryCtx ((CF_Mutex_Ctx) context);
    249257    }
    250258
    251     return CF_OK;
     259    return result;
    252260}
    253261
Note: See TracChangeset for help on using the changeset viewer.