Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

static int kPrfMutexInit ( KPRF_TYPE(P, MUTEX)  pMutex  )  [static]

Initializes a mutex.

Returns:
0 on success.

-1 on failure.

Parameters:
pMutex The mutex to init.

Definition at line 505 of file kProfileR3.cpp.

Referenced by kPrfInitialize(), and kPrfRWLockInit().

{
#if defined(KPRF_USE_PTHREAD)
    if (!pthread_mutex_init(pMutex, NULL));
        return 0;
    return -1;

#elif K_OS == K_OS_WINDOWS
    InitializeCriticalSection(pMutex);
    return 0;

#elif K_OS == K_OS_OS2
    if (!_fmutex_create(pMutex, 0))
        return 0;
    return -1;
#endif
}


Generated by  Doxygen 1.6.0   Back to index