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

static void kPrfRWLockDelete ( KPRF_TYPE(P, RWLOCK)  pRWLock  )  [inline, static]

Deleters a read-write lock.

Parameters:
pRWLock The read-write lock to delete.

Definition at line 639 of file kProfileR3.cpp.

References kPrfMutexDelete().

Referenced by kPrfInitialize(), and kPrfTerminate().

{
#if defined(KPRF_USE_PTHREAD)
    pthread_rwlock_destroy(pRWLock);

#elif K_OS == K_OS_WINDOWS || K_OS == K_OS_OS2
    if (pRWLock->enmState == RWLOCK_STATE_UNINITIALIZED)
        return;

    pRWLock->enmState = RWLOCK_STATE_UNINITIALIZED;
    kPrfMutexDelete(&pRWLock->Mutex);
    pRWLock->cReaders = 0;
    pRWLock->cReadersWaiting = 0;
    pRWLock->cWritersWaiting = 0;
# if K_OS == K_OS_WINDOWS
    CloseHandle(pRWLock->hevReaders);
    pRWLock->hevReaders = INVALID_HANDLE_VALUE;
    CloseHandle(pRWLock->hevWriters);
    pRWLock->hevWriters = INVALID_HANDLE_VALUE;

# elif K_OS == K_OS_OS2
    DosCloseEventSem(pRWLock->hevReaders);
    pRWLock->hevReaders = NULLHANDLE;
    DosCloseEventSem(pRWLock->hevWriters);
    pRWLock->hevWriters = NULLHANDLE;
# endif
#endif
}


Generated by  Doxygen 1.6.0   Back to index