VirtualBox

Changeset 22074 in vbox


Ignore:
Timestamp:
Aug 7, 2009 3:27:36 PM (15 years ago)
Author:
vboxsync
Message:

semaphore-r0drv-darwin.cpp: cMillies == 0 will not block.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/darwin/semaphore-r0drv-darwin.cpp

    r22052 r22074  
    217217                    ("pEventInt=%p u32Magic=%#x\n", pEventInt, pEventInt->u32Magic),
    218218                    VERR_INVALID_HANDLE);
    219     RT_ASSERT_PREEMPTIBLE();
    220        
     219    if (cMillies)
     220        RT_ASSERT_PREEMPTIBLE();
     221
    221222    lck_spin_lock(pEventInt->pSpinlock);
    222223
     
    228229        rc = VINF_SUCCESS;
    229230    }
     231    else if (!cMillies)
     232        rc = VERR_TIMEOUT;
    230233    else
    231234    {
     
    408411                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
    409412                    VERR_INVALID_HANDLE);
     413    RT_ASSERT_PREEMPT_CPUID_VAR();
     414    RT_ASSERT_INTS_ON();
    410415
    411416    lck_spin_lock(pEventMultiInt->pSpinlock);
    412417    ASMAtomicXchgU8(&pEventMultiInt->fSignaled, false);
    413418    lck_spin_unlock(pEventMultiInt->pSpinlock);
     419
     420    RT_ASSERT_PREEMPT_CPUID();
    414421    return VINF_SUCCESS;
    415422}
     
    423430                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
    424431                    VERR_INVALID_HANDLE);
    425     RT_ASSERT_PREEMPTIBLE();
     432    if (cMillies)
     433        RT_ASSERT_PREEMPTIBLE();
    426434
    427435    lck_spin_lock(pEventMultiInt->pSpinlock);
     
    430438    if (pEventMultiInt->fSignaled)
    431439        rc = VINF_SUCCESS;
     440    else if (!cMillies)
     441        rc = VERR_TIMEOUT;
    432442    else
    433443    {
     
    578588              ("pMutexInt->u32Magic=%RX32 pMutexInt=%p\n", pMutexInt->u32Magic, pMutexInt)
    579589              VERR_INVALID_PARAMETER);
    580     RT_ASSERT_PREEMPTIBLE();
     590    if (cMillies)
     591        RT_ASSERT_PREEMPTIBLE();
    581592
    582593    /*
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