- Timestamp:
- Mar 26, 2013 9:28:43 AM (12 years ago)
- Location:
- trunk/src/VBox/Runtime/common/misc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/handletable.cpp
r44529 r45187 5 5 6 6 /* 7 * Copyright (C) 2008-201 2Oracle Corporation7 * Copyright (C) 2008-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 58 58 AssertPtrNullReturn(pfnRetain, VERR_INVALID_POINTER); 59 59 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); 60 62 AssertReturn(cMax > 0, VERR_INVALID_PARAMETER); 61 63 AssertReturn(UINT32_MAX - cMax >= uBase, VERR_INVALID_PARAMETER); … … 101 103 pThis->iFreeHead = NIL_RTHT_INDEX; 102 104 pThis->iFreeTail = NIL_RTHT_INDEX; 103 if (fFlags & RTHANDLETABLE_FLAGS_LOCKED)105 if (fFlags & (RTHANDLETABLE_FLAGS_LOCKED | RTHANDLETABLE_FLAGS_LOCKED_IRQ_SAFE)) 104 106 { 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"); 106 112 if (RT_FAILURE(rc)) 107 113 { -
trunk/src/VBox/Runtime/common/misc/handletable.h
r44529 r45187 5 5 6 6 /* 7 * Copyright (C) 2008-201 2Oracle Corporation7 * Copyright (C) 2008-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 223 223 { 224 224 if (pThis->hSpinlock != NIL_RTSPINLOCK) 225 {226 225 RTSpinlockAcquire(pThis->hSpinlock); 227 }228 226 } 229 227
Note:
See TracChangeset
for help on using the changeset viewer.