VirtualBox

Changeset 22770 in vbox


Ignore:
Timestamp:
Sep 4, 2009 9:51:34 AM (15 years ago)
Author:
vboxsync
Message:

Solaris/semevent-r0drv: prevent deadlock when waking threads from interrupt context (#4259)

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

Legend:

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

    r22073 r22770  
    139139    RT_ASSERT_INTS_ON();
    140140
    141     mutex_enter(&pEventInt->Mtx);
     141    /*
     142     * If we're in interrupt context we need to unpin the underlying current
     143     * thread as this could lead to a deadlock (see #4259 for the full explanation)
     144     */
     145    int fAcquired = mutex_tryenter(&pEventInt->Mtx);
     146    if (!fAcquired)
     147    {
     148        if (curthread->t_intr && getpil() < DISP_LEVEL)
     149            swtch();
     150
     151        mutex_enter(&pEventInt->Mtx);
     152    }
    142153
    143154    if (pEventInt->cWaiters > 0)
  • trunk/src/VBox/Runtime/r0drv/solaris/semeventmulti-r0drv-solaris.c

    r22073 r22770  
    138138    RT_ASSERT_INTS_ON();
    139139
    140     mutex_enter(&pThis->Mtx);
     140    /*
     141     * If we're in interrupt context we need to unpin the underlying current
     142     * thread as this could lead to a deadlock (see #4259 for the full explanation)
     143     */
     144    int fAcquired = mutex_tryenter(&pThis->Mtx);
     145    if (!fAcquired)
     146    {
     147        if (curthread->t_intr && getpil() < DISP_LEVEL)
     148            swtch();
     149
     150        mutex_enter(&pThis->Mtx);
     151    }
    141152
    142153    ASMAtomicXchgU8(&pThis->fSignaled, true);
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