VirtualBox

Changeset 22773 in vbox


Ignore:
Timestamp:
Sep 4, 2009 10:14:17 AM (15 years ago)
Author:
vboxsync
Message:

semevent-r0drv-solaris.c, semeventmulti-r0drv-solaris.c: Added preemption note and applied the workaround to RTSemEventMultiReset as well just to be on the safe side.

Location:
trunk/src/VBox/Runtime/r0drv/solaris
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/semevent-r0drv-solaris.c

    r22770 r22773  
    142142     * If we're in interrupt context we need to unpin the underlying current
    143143     * thread as this could lead to a deadlock (see #4259 for the full explanation)
     144     *
     145     * Note! This assumes nobody is using the RTThreadPreemptDisable in an
     146     *       interrupt context and expects it to work right.  The swtch will
     147     *       result in a voluntary preemption.  To fix this, we would have to
     148     *       do our own counting in RTThreadPreemptDisable/Restore like we do
     149     *       on systems which doesn't do preemption (OS/2, linux, ...) and
     150     *       check whether preemption was disabled via RTThreadPreemptDisable
     151     *       or not and only call swtch if RTThreadPreemptDisable wasn't called.
    144152     */
    145153    int fAcquired = mutex_tryenter(&pEventInt->Mtx);
  • trunk/src/VBox/Runtime/r0drv/solaris/semeventmulti-r0drv-solaris.c

    r22770 r22773  
    141141     * If we're in interrupt context we need to unpin the underlying current
    142142     * thread as this could lead to a deadlock (see #4259 for the full explanation)
     143     *
     144     * Note! See remarks about preemption in RTSemEventSignal.
    143145     */
    144146    int fAcquired = mutex_tryenter(&pThis->Mtx);
     
    177179    RT_ASSERT_INTS_ON();
    178180
    179     mutex_enter(&pThis->Mtx);
     181    /*
     182     * If we're in interrupt context we need to unpin the underlying current
     183     * thread as this could lead to a deadlock (see #4259 for the full explanation)
     184     *
     185     * Note! See remarks about preemption in RTSemEventSignal.
     186     */
     187    int fAcquired = mutex_tryenter(&pThis->Mtx);
     188    if (!fAcquired)
     189    {
     190        if (curthread->t_intr && getpil() < DISP_LEVEL)
     191            swtch();
     192
     193        mutex_enter(&pThis->Mtx);
     194    }
     195
    180196    ASMAtomicXchgU8(&pThis->fSignaled, false);
    181197    mutex_exit(&pThis->Mtx);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette