VirtualBox

Ignore:
Timestamp:
Apr 28, 2010 11:17:52 PM (15 years ago)
Author:
vboxsync
Message:

Main/HostHardwareLinux: use inotify instead of FAM for USB hotplug probing, and disable the hal/dbus method for now to get testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/testcase/tstHostHardwareLinux.cpp

    r28800 r28882  
    3535#include <stdlib.h>
    3636
    37 void doHotplugEvent(VBoxMainHotplugWaiter *waiter, RTMSINTERVAL cMillies)
     37int doHotplugEvent(VBoxMainHotplugWaiter *waiter, RTMSINTERVAL cMillies)
    3838{
     39    int rc;
    3940    while (true)
    4041    {
    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)
    4844            break;
    4945        if (RT_FAILURE(rc))
     
    5551            break;
    5652    }
     53    return rc;
    5754}
    5855
     
    154151    RTPrintf ("Waiting for a hotplug event, Ctrl-C to abort...\n");
    155152    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!");
    156157#endif  /* VBOX_USB_WITH_SYSFS */
    157158    return 0;
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