Changeset 30933 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jul 20, 2010 4:16:06 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/semevent-r0drv-solaris.c
r30711 r30933 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 183 183 } 184 184 185 /* 186 * If there are more waiting threads, wake them up. Otherwise leave the 187 * semaphore in the signalled state. 188 */ 185 189 pThis->cWakeUp++; 186 if (pThis->cWakeUp <= pThis->cWaiters) 187 { 188 /* 189 * We decrement waiters here so that we don't keep signalling threads that 190 * have already been signalled but not yet scheduled. So cWaiters might be 191 * 0 even when there are threads actually waiting. 192 */ 190 if (pThis->cWakeUp <= pThis->cWaiters) /** @todo r=bird: see cWakeup = 0 below. */ 191 { 193 192 cv_signal(&pThis->Cnd); 194 193 pThis->uSignalGen++; … … 256 255 Assert(!pThis->cWaiters); 257 256 pThis->fSignaled = false; 258 pThis->cWakeUp = 0; 257 /** @todo r=bird: This will get out of whack if someone is in the 258 * process of waking up (waiting to be scheduled). Further 259 * more, a race between a cv_signal and a 260 * timeout/interruption may cause wakeups to go unconsumed. 261 * Not sure how we could easily deal with this rigth now... */ 262 pThis->cWakeUp = 0; 259 263 rc = VINF_SUCCESS; 260 264 } … … 276 280 { 277 281 /* We've been signaled by cv_signal(), consume the wake up. */ 278 --pThis->cWakeUp; 282 --pThis->cWakeUp; /** @todo r=bird: May cause underflow, see above. */ 279 283 rc = VINF_SUCCESS; 280 284 } … … 294 298 rc = VERR_INTERRUPTED; 295 299 296 --pThis->cWaiters;297 300 break; 298 301 } 302 --pThis->cWaiters; 299 303 } 300 304
Note:
See TracChangeset
for help on using the changeset viewer.