Changeset 21555 in vbox for trunk/src/VBox/Runtime/r0drv
- Timestamp:
- Jul 13, 2009 4:51:25 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c
r21554 r21555 79 79 * This is NIL if the semaphore is not owned by anyone. */ 80 80 RTNATIVETHREAD volatile hOwner; 81 /** Number of threads waiting for the lock. */81 /** Number of threads that are fighting for the lock. */ 82 82 int32_t volatile cLockers; 83 83 /** The semaphore to block on. */ … … 126 126 pThis->fFlags = fFlags; 127 127 pThis->hOwner = NIL_RTNATIVETHREAD; 128 pThis->cLockers = -1;128 pThis->cLockers = 0; 129 129 rc = RTSemEventCreate(&pThis->hEventSem); 130 130 if (RT_SUCCESS(rc)) … … 401 401 cLockers = ASMAtomicDecS32(&pThis->cLockers); 402 402 rtSemSpinMutexLeave(&State); 403 if (cLockers > =0)403 if (cLockers > 0) 404 404 { 405 405 int rc = RTSemEventSignal(pThis->hEventSem); … … 423 423 424 424 /* No destruction races allowed! */ 425 AssertMsg( pThis->cLockers == -1425 AssertMsg( pThis->cLockers == 0 426 426 && pThis->hOwner == NIL_RTNATIVETHREAD, 427 427 ("pThis=%p cLockers=%d hOwner=%p\n", pThis, pThis->cLockers, pThis->hOwner));
Note:
See TracChangeset
for help on using the changeset viewer.