Example #1
0
/** \brief Destroy the condition variable
 *
 * \b os_condDestroy calls \b pthread_cond_destroy to destroy the
 * posix condition variable.
 */
os_result
os_condDestroy(
    os_cond *cond)
{
    os_result result;

    assert (cond != NULL);

    if (cond->scope == OS_SCOPE_SHARED) {
        result = returnSem(cond);
        return result;
    } else {
        CloseHandle((HANDLE)cond->qId);
        result = os_resultSuccess;
    }
    return result;
}
Example #2
0
/** \brief Destroy the condition variable
 *
 * \b os_condDestroy calls \b pthread_cond_destroy to destroy the
 * posix condition variable.
 */
void
os_condDestroy(
    os_cond *cond)
{
    os_result result;

    assert (cond != NULL);

    if (cond->scope == OS_SCOPE_SHARED) {
        result = returnSem(cond);
        if(result != os_resultSuccess) {
            abort();
        }
    } else {
        CloseHandle((HANDLE)cond->qId);
    }
}