VirtualBox

Changeset 45187 in vbox for trunk/src


Ignore:
Timestamp:
Mar 26, 2013 9:28:43 AM (12 years ago)
Author:
vboxsync
Message:

iprt/handletable.h: New handle table flag: RTHANDLETABLE_FLAGS_LOCKED_IRQ_SAFE.

Location:
trunk/src/VBox/Runtime/common/misc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/handletable.cpp

    r44529 r45187  
    55
    66/*
    7  * Copyright (C) 2008-2012 Oracle Corporation
     7 * Copyright (C) 2008-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5858    AssertPtrNullReturn(pfnRetain, VERR_INVALID_POINTER);
    5959    AssertReturn(!(fFlags & ~RTHANDLETABLE_FLAGS_MASK), VERR_INVALID_PARAMETER);
     60    AssertReturn(RT_BOOL(fFlags & RTHANDLETABLE_FLAGS_LOCKED) + RT_BOOL(fFlags & RTHANDLETABLE_FLAGS_LOCKED_IRQ_SAFE) < 2,
     61                 VERR_INVALID_PARAMETER);
    6062    AssertReturn(cMax > 0, VERR_INVALID_PARAMETER);
    6163    AssertReturn(UINT32_MAX - cMax >= uBase, VERR_INVALID_PARAMETER);
     
    101103    pThis->iFreeHead = NIL_RTHT_INDEX;
    102104    pThis->iFreeTail = NIL_RTHT_INDEX;
    103     if (fFlags & RTHANDLETABLE_FLAGS_LOCKED)
     105    if (fFlags & (RTHANDLETABLE_FLAGS_LOCKED | RTHANDLETABLE_FLAGS_LOCKED_IRQ_SAFE))
    104106    {
    105         int rc = RTSpinlockCreate(&pThis->hSpinlock, RTSPINLOCK_FLAGS_INTERRUPT_UNSAFE, "RTHandleTableCreateEx");
     107        int rc;
     108        if (fFlags & RTHANDLETABLE_FLAGS_LOCKED_IRQ_SAFE)
     109            rc = RTSpinlockCreate(&pThis->hSpinlock, RTSPINLOCK_FLAGS_INTERRUPT_SAFE, "RTHandleTableCreateEx");
     110        else
     111            rc = RTSpinlockCreate(&pThis->hSpinlock, RTSPINLOCK_FLAGS_INTERRUPT_UNSAFE, "RTHandleTableCreateEx");
    106112        if (RT_FAILURE(rc))
    107113        {
  • trunk/src/VBox/Runtime/common/misc/handletable.h

    r44529 r45187  
    55
    66/*
    7  * Copyright (C) 2008-2012 Oracle Corporation
     7 * Copyright (C) 2008-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    223223{
    224224    if (pThis->hSpinlock != NIL_RTSPINLOCK)
    225     {
    226225        RTSpinlockAcquire(pThis->hSpinlock);
    227     }
    228226}
    229227
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