本文整理汇总了C++中SerialDevice::Free方法的典型用法代码示例。如果您正苦于以下问题:C++ SerialDevice::Free方法的具体用法?C++ SerialDevice::Free怎么用?C++ SerialDevice::Free使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SerialDevice
的用法示例。
在下文中一共展示了SerialDevice::Free方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/* usb_serial_free - called after last device is closed, and all i/o complete. */
static status_t
usb_serial_free(void *cookie)
{
TRACE_FUNCALLS("> usb_serial_free(0x%08x)\n", cookie);
SerialDevice *device = (SerialDevice *)cookie;
acquire_sem(gDriverLock);
status_t status = device->Free();
if (device->IsRemoved()) {
for (int32 i = 0; i < DEVICES_COUNT; i++) {
if (gSerialDevices[i] == device) {
// the device is removed already but as it was open the
// removed hook has not deleted the object
delete device;
gSerialDevices[i] = NULL;
break;
}
}
}
release_sem(gDriverLock);
return status;
}