Changeset 57990 in vbox for trunk/src/VBox/Main/src-server/darwin
- Timestamp:
- Oct 1, 2015 5:53:32 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 103011
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/darwin/USBProxyServiceDarwin.cpp
r57358 r57990 53 53 HRESULT USBProxyServiceDarwin::init(void) 54 54 { 55 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN56 55 /* 57 56 * Initialize the USB library. … … 64 63 } 65 64 mUSBLibInitialized = true; 66 #endif67 65 68 66 /* … … 87 85 stop(); 88 86 89 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN90 87 /* 91 88 * Terminate the USB library - it'll … … 96 93 mUSBLibInitialized = false; 97 94 } 98 #endif 99 } 100 101 102 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN 95 } 96 97 103 98 void *USBProxyServiceDarwin::insertFilter(PCUSBFILTER aFilter) 104 99 { … … 111 106 USBLibRemoveFilter(aId); 112 107 } 113 #endif /* VBOX_WITH_NEW_USB_CODE_ON_DARWIN */114 108 115 109 … … 127 121 Assert(aDevice->i_getUnistate() == kHostUSBDeviceState_Capturing); 128 122 129 #ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN130 /*131 * Fake it.132 */133 ASMAtomicWriteBool(&mFakeAsync, true);134 devLock.release();135 interruptWait();136 return VINF_SUCCESS;137 138 #else139 123 /* 140 124 * Create a one-shot capture filter for the device (don't … … 159 143 LogFlowThisFunc(("returns %Rrc pvId=%p\n", rc, pvId)); 160 144 return rc; 161 #endif162 145 } 163 146 … … 166 149 { 167 150 AssertReturnVoid(aDevice->isWriteLockOnCurrentThread()); 168 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN 151 169 152 /* 170 153 * Remove the one-shot filter if necessary. … … 174 157 USBLibRemoveFilter(aDevice->mOneShotId); 175 158 aDevice->mOneShotId = NULL; 176 #endif177 159 } 178 160 … … 191 173 Assert(aDevice->i_getUnistate() == kHostUSBDeviceState_ReleasingToHost); 192 174 193 #ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN194 /*195 * Fake it.196 */197 ASMAtomicWriteBool(&mFakeAsync, true);198 devLock.release();199 interruptWait();200 return VINF_SUCCESS;201 202 #else203 175 /* 204 176 * Create a one-shot ignore filter for the device … … 225 197 LogFlowThisFunc(("returns %Rrc pvId=%p\n", rc, pvId)); 226 198 return rc; 227 #endif228 199 } 229 200 … … 232 203 { 233 204 AssertReturnVoid(aDevice->isWriteLockOnCurrentThread()); 234 #ifdef VBOX_WITH_NEW_USB_CODE_ON_DARWIN 205 235 206 /* 236 207 * Remove the one-shot filter if necessary. … … 240 211 USBLibRemoveFilter(aDevice->mOneShotId); 241 212 aDevice->mOneShotId = NULL; 242 #endif243 213 } 244 214 … … 247 217 void USBProxyServiceDarwin::detachingDevice(HostUSBDevice *aDevice) 248 218 { 249 #ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN250 aDevice->setLogicalReconnect(HostUSBDevice::kDetachingPendingDetach);251 #else252 219 NOREF(aDevice); 253 #endif254 220 } 255 221 … … 259 225 AssertReturn(aDevice, false); 260 226 AssertReturn(!aDevice->isWriteLockOnCurrentThread(), false); 261 #ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN 262 /* We're faking async state stuff. */ 263 return updateDeviceStateFake(aDevice, aUSBDevice, aRunFilters, aIgnoreMachine); 264 #else 265 /* Nothing special here so far, so fall back on parent */ 227 /* Nothing special here so far, so fall back on parent. */ 266 228 return USBProxyService::updateDeviceState(aDevice, aUSBDevice, aRunFilters, aIgnoreMachine); 267 #endif268 229 } 269 230 … … 271 232 int USBProxyServiceDarwin::wait(RTMSINTERVAL aMillies) 272 233 { 273 #ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN274 if ( mFakeAsync275 && ASMAtomicXchgBool(&mFakeAsync, false))276 return VINF_SUCCESS;277 #endif278 279 234 SInt32 rc = CFRunLoopRunInMode(CFSTR(VBOX_IOKIT_MODE_STRING), 280 235 mWaitABitNextTime && aMillies >= 1000
Note:
See TracChangeset
for help on using the changeset viewer.