static void umock_lock_pthreads_destroy()

in src/umock_lock_factory_pthread.c [91:110]


static void umock_lock_pthreads_destroy(UMOCK_C_LOCK_HANDLE lock)
{
    if (lock == NULL)
    {
        /* Codes_SRS_UMOCK_LOCK_FACTORY_PTHREAD_01_014: [ If lock is NULL, umock_lock_pthread_destroy shall return. ]*/
        UMOCK_LOG("Invalid arguments: UMOCK_C_LOCK_HANDLE lock=%p", lock);
    }
    else
    {
        UMOCK_C_LOCK_PTHREAD* umock_c_lock_pthread = (UMOCK_C_LOCK_PTHREAD*)lock;
        /* Codes_SRS_UMOCK_LOCK_FACTORY_WINDOWS_01_001: [ umock_lock_pthread_destroy shall release the resources for the pthread lock by calling pthread_rwlock_destroy. ]*/
        if (pthread_rwlock_destroy(&umock_c_lock_pthread->rw_lock) != 0)
        {
            UMOCK_LOG("pthread_rwlock_destroy failed");
        }

        /* Codes_SRS_UMOCK_LOCK_FACTORY_PTHREAD_01_009: [ umock_lock_pthread_destroy shall free the memory associated with the lock. ]*/
        umockalloc_free(umock_c_lock_pthread);
    }
}