Changeset 22038 in vbox for trunk/src/VBox
- Timestamp:
- Aug 6, 2009 4:27:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c
r21933 r22038 184 184 } 185 185 186 #elif defined(RT_OS_LINUX) || defined(RT_OS_OS2) || defined(RT_OS_SOLARIS) 187 /* 188 * OSes on which RTSemEventSignal can be called from any context. 189 */ 186 #elif defined(RT_OS_SOLARIS) 187 /* 188 * Solaris: RTSemEventSignal will do bad stuff on S10 if interrupts are disabled. 189 */ 190 if (!ASMIntAreEnabled()) 191 return VERR_SEM_BAD_CONTEXT; 192 190 193 pState->fSpin = !RTThreadPreemptIsEnabled(NIL_RTTHREAD); 191 194 if (RTThreadIsInInterrupt(NIL_RTTHREAD)) … … 198 201 RTThreadPreemptDisable(&pState->PreemptState); 199 202 203 #elif defined(RT_OS_LINUX) || defined(RT_OS_OS2) 204 /* 205 * OSes on which RTSemEventSignal can be called from any context. 206 */ 207 pState->fSpin = !RTThreadPreemptIsEnabled(NIL_RTTHREAD); 208 if (RTThreadIsInInterrupt(NIL_RTTHREAD)) 209 { 210 if (!(pThis->fFlags & RTSEMSPINMUTEX_FLAGS_IRQ_SAFE)) 211 rc = VINF_SEM_BAD_CONTEXT; /* Try, but owner might be interrupted. */ 212 pState->fSpin = true; 213 } 214 pState->PreemptState = StateInit; 215 RTThreadPreemptDisable(&pState->PreemptState); 216 200 217 #else /* PORTME: Check for context where we cannot wake up threads. */ 201 218 /* 202 * Default: ASSUME thread can be woken up from all context except interrupt. 219 * Default: ASSUME thread can be woken up if interrupts are enabled and 220 * we're not in an interrupt context. 203 221 * ASSUME that we can go to sleep if preemption is enabled. 204 222 */ 205 if (RTThreadIsInInterrupt(NIL_RTTHREAD)) 223 if ( RTThreadIsInInterrupt(NIL_RTTHREAD) 224 || !ASMIntAreEnabled()) 206 225 return VERR_SEM_BAD_CONTEXT; 226 207 227 pState->fSpin = !RTThreadPreemptIsEnabled(NIL_RTTHREAD); 208 228 pState->PreemptState = StateInit;
Note:
See TracChangeset
for help on using the changeset viewer.