Changeset 28882 in vbox for trunk/src/VBox/Main/testcase/tstHostHardwareLinux.cpp
- Timestamp:
- Apr 28, 2010 11:17:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/tstHostHardwareLinux.cpp
r28800 r28882 35 35 #include <stdlib.h> 36 36 37 voiddoHotplugEvent(VBoxMainHotplugWaiter *waiter, RTMSINTERVAL cMillies)37 int doHotplugEvent(VBoxMainHotplugWaiter *waiter, RTMSINTERVAL cMillies) 38 38 { 39 int rc; 39 40 while (true) 40 41 { 41 int rc = waiter->Wait (cMillies); 42 if (rc == VERR_TRY_AGAIN) 43 { 44 RTThreadYield(); 45 continue; 46 } 47 if (rc == VERR_TIMEOUT) 42 rc = waiter->Wait (cMillies); 43 if (rc == VERR_TIMEOUT || rc == VERR_INTERRUPTED) 48 44 break; 49 45 if (RT_FAILURE(rc)) … … 55 51 break; 56 52 } 53 return rc; 57 54 } 58 55 … … 154 151 RTPrintf ("Waiting for a hotplug event, Ctrl-C to abort...\n"); 155 152 doHotplugEvent(&waiter, RT_INDEFINITE_WAIT); 153 RTPrintf ("Testing interrupting a hotplug event...\n"); 154 waiter.Interrupt(); 155 rc = doHotplugEvent(&waiter, 5000); 156 RTPrintf ("%s\n", rc == VERR_INTERRUPTED ? "Success!" : "Failed!"); 156 157 #endif /* VBOX_USB_WITH_SYSFS */ 157 158 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.