本文整理汇总了C++中IOWorkLoop::removeEventSource方法的典型用法代码示例。如果您正苦于以下问题:C++ IOWorkLoop::removeEventSource方法的具体用法?C++ IOWorkLoop::removeEventSource怎么用?C++ IOWorkLoop::removeEventSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOWorkLoop
的用法示例。
在下文中一共展示了IOWorkLoop::removeEventSource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stop
void BrcmPatchRAM::stop(IOService* provider)
{
uint64_t stop_time, nano_secs;
clock_get_uptime(&stop_time);
absolutetime_to_nanoseconds(stop_time - wake_time, &nano_secs);
uint64_t milli_secs = nano_secs / 1000000;
AlwaysLog("Time since wake %llu.%llu seconds.\n", milli_secs / 1000, milli_secs % 1000);
DebugLog("stop\n");
OSSafeReleaseNULL(mFirmwareStore);
IOWorkLoop* workLoop = getWorkLoop();
if (workLoop)
{
if (mTimer)
{
mTimer->cancelTimeout();
workLoop->removeEventSource(mTimer);
mTimer->release();
mTimer = NULL;
}
if (mWorkSource)
{
workLoop->removeEventSource(mWorkSource);
mWorkSource->release();
mWorkSource = NULL;
mWorkPending = 0;
}
}
PMstop();
if (mCompletionLock)
{
IOLockFree(mCompletionLock);
mCompletionLock = NULL;
}
if (mWorkLock)
{
IOLockFree(mWorkLock);
mWorkLock = NULL;
}
OSSafeReleaseNULL(mDevice);
super::stop(provider);
}
示例2: start
bool BrcmPatchRAM::start(IOService *provider)
{
DebugLog("start\n");
if (!super::start(provider))
return false;
// add interrupt source for delayed actions...
IOWorkLoop* workLoop = getWorkLoop();
if (!workLoop)
return false;
mWorkSource = IOInterruptEventSource::interruptEventSource(this, OSMemberFunctionCast(IOInterruptEventAction, this, &BrcmPatchRAM::processWorkQueue));
if (!mWorkSource)
return false;
workLoop->addEventSource(mWorkSource);
mWorkPending = 0;
// add timer for firmware load in the case no re-probe after wake
mTimer = IOTimerEventSource::timerEventSource(this, OSMemberFunctionCast(IOTimerEventSource::Action, this, &BrcmPatchRAM::onTimerEvent));
if (!mTimer)
{
workLoop->removeEventSource(mWorkSource);
mWorkSource->release();
mWorkSource = NULL;
return false;
}
workLoop->addEventSource(mTimer);
// register for power state notifications
PMinit();
registerPowerDriver(this, myTwoStates, 2);
provider->joinPMtree(this);
return true;
}
示例3: stop
void IOHIDEventSystemUserClient::stop( IOService * provider )
{
IOWorkLoop * workLoop = getWorkLoop();
if (workLoop && commandGate)
{
workLoop->removeEventSource(commandGate);
}
}
示例4: IOLog
void SoftU2FUserClient::stop(IOService *provider) {
IOLog("%s[%p]::%s(%p)\n", getName(), this, __FUNCTION__, provider);
IOWorkLoop *workLoop = getWorkLoop();
if (workLoop && _commandGate)
workLoop->removeEventSource(_commandGate);
super::stop(provider);
}
示例5: stop
void ACPIBacklightPanel::stop( IOService * provider )
{
DbgLog("%s::%s()\n", this->getName(),__FUNCTION__);
IOWorkLoop* workLoop = getWorkLoop();
if (workLoop)
{
if (_workSource)
{
workLoop->removeEventSource(_workSource);
_workSource->release();
_workSource = NULL;
}
if (_smoothTimer)
{
workLoop->removeEventSource(_smoothTimer);
_smoothTimer->release();
_smoothTimer = NULL;
}
if (_cmdGate)
{
workLoop->removeEventSource(_cmdGate);
_cmdGate->release();
_cmdGate = NULL;
}
}
_extended = false;
if (_lock)
{
IORecursiveLockFree(_lock);
_lock = NULL;
}
#if 0
OSSafeReleaseNULL(_provider);
#endif
_backlightHandler = NULL;
super::stop(provider);
}
示例6:
void IOFireWireSBP2LUN::free( void )
{
FWKLOG( ( "IOFireWireSBP2LUN<%p> : free\n", this ) );
//
// free unreleased orbs
//
// flushAllManagementORBs();
if( fORBSetIterator )
fORBSetIterator->release();
if( fORBSet )
fORBSet->release();
//
// release login set
//
if( fLoginSetIterator )
fLoginSetIterator->release();
if( fLoginSet )
fLoginSet->release();
//
// destroy command gate
//
if( fGate != NULL )
{
IOWorkLoop * workLoop = NULL;
workLoop = fGate->getWorkLoop();
workLoop->removeEventSource( fGate );
workLoop->release();
fGate->release();
fGate = NULL;
}
if( fProviderTarget )
{
fProviderTarget->release();
fProviderTarget = NULL;
}
IOService::free();
}
示例7:
void
IOCommandPool::free(void)
{
if (fSerializer) {
// remove our event source from owner's workloop
IOWorkLoop *wl = fSerializer->getWorkLoop();
if (wl)
wl->removeEventSource(fSerializer);
fSerializer->release();
fSerializer = 0;
}
// Tell our superclass to cleanup too
super::free();
}
示例8: disableVmmDevInterrupts
bool org_virtualbox_VBoxGuest::disableVmmDevInterrupts(void)
{
IOWorkLoop *pWorkLoop = (IOWorkLoop *)getWorkLoop();
if (!pWorkLoop)
return false;
if (!m_pInterruptSrc)
return false;
m_pInterruptSrc->disable();
pWorkLoop->removeEventSource(m_pInterruptSrc);
m_pInterruptSrc->release();
m_pInterruptSrc = NULL;
return true;
}
示例9: start
bool BrcmPatchRAM::start(IOService *provider)
{
DebugLog("start\n");
if (!super::start(provider))
return false;
// place version/build info in ioreg properties RM,Build and RM,Version
char buf[128];
snprintf(buf, sizeof(buf), "%s %s", OSKextGetCurrentIdentifier(), OSKextGetCurrentVersionString());
setProperty("RM,Version", buf);
#ifdef DEBUG
setProperty("RM,Build", "Debug-" LOGNAME);
#else
setProperty("RM,Build", "Release-" LOGNAME);
#endif
// add interrupt source for delayed actions...
IOWorkLoop* workLoop = getWorkLoop();
if (!workLoop)
return false;
mWorkSource = IOInterruptEventSource::interruptEventSource(this, OSMemberFunctionCast(IOInterruptEventAction, this, &BrcmPatchRAM::processWorkQueue));
if (!mWorkSource)
return false;
workLoop->addEventSource(mWorkSource);
mWorkPending = 0;
// add timer for firmware load in the case no re-probe after wake
mTimer = IOTimerEventSource::timerEventSource(this, OSMemberFunctionCast(IOTimerEventSource::Action, this, &BrcmPatchRAM::onTimerEvent));
if (!mTimer)
{
workLoop->removeEventSource(mWorkSource);
mWorkSource->release();
mWorkSource = NULL;
return false;
}
workLoop->addEventSource(mTimer);
// register for power state notifications
PMinit();
registerPowerDriver(this, myTwoStates, 2);
provider->joinPMtree(this);
return true;
}
示例10: handleStop
// Shut down the driver
void WirelessHIDDevice::handleStop(IOService *provider)
{
WirelessDevice *device = OSDynamicCast(WirelessDevice, provider);
if (device != NULL)
device->RegisterWatcher(NULL, NULL, NULL);
if (serialTimer != NULL) {
serialTimer->cancelTimeout();
IOWorkLoop *workloop = getWorkLoop();
if (workloop != NULL)
workloop->removeEventSource(serialTimer);
serialTimer->release();
serialTimer = NULL;
}
super::handleStop(provider);
}
示例11: stop
void BatteryTracker::stop(IOService* provider)
{
DEBUG_LOG("BatteryTracker::stop: entering stop\n");
OSSafeReleaseNULL(m_pBatteryList);
if (NULL != m_pLock)
{
IORecursiveLockFree(m_pLock);
m_pLock = NULL;
}
if (m_pCmdGate)
{
IOWorkLoop* pWorkLoop = getWorkLoop();
if (pWorkLoop)
pWorkLoop->removeEventSource(m_pCmdGate);
m_pCmdGate->release();
m_pCmdGate = NULL;
}
IOService::stop(provider);
}
示例12: stop
void AppleSmartBatteryManager::stop(IOService *provider)
{
DEBUG_LOG("AppleSmartBatteryManager::stop: called\n");
fBattery->detach(this);
fBattery->free();
fBattery->stop(this);
fBattery->terminate();
fBattery = NULL;
IOWorkLoop *wl = getWorkLoop();
if (wl) {
wl->removeEventSource(fBatteryGate);
}
fBatteryGate->free();
fBatteryGate = NULL;
PMstop();
super::stop(provider);
}
示例13: free
void IrDAComm::free()
{
IOWorkLoop *workloop;
XTRACE(kLogFree, 0, this);
this->Stop(); // make sure we're stopped before releasing memory
if (fDriver) {
workloop = fDriver->getWorkLoop();
if (workloop) {
if (fGate)
workloop->removeEventSource(fGate);
//if (fTimerSrc)
// workloop->removeEventSource(fTimerSrc);
}
}
#define FREE(x) { if (x) { (x)->release(); x = nil; }}
FREE(fGate);
FREE(fTimer);
FREE(fIrComm); // free the ircomm object before the rest of irda ...
FREE(fIrDA);
#undef FREE
#define THREAD_FREE(x) do { if (x) { \
thread_call_cancel(x); \
thread_call_free(x); \
x = NULL; } } while(0)
THREAD_FREE(fStop_thread);
#undef THREAD_FREE
super::free(); // we're done, call super
}
示例14: assert
void ApplePS2Mouse::stop(IOService * provider)
{
//
// The driver has been instructed to stop. Note that we must break all
// connections to other service objects now (ie. no registered actions,
// no pointers and retains to objects, etc), if any.
//
assert(_device == provider);
//
// Disable the mouse itself, so that it may stop reporting mouse events.
//
setMouseEnable(false);
// free up the command gate
IOWorkLoop* pWorkLoop = getWorkLoop();
if (pWorkLoop)
{
if (_cmdGate)
{
pWorkLoop->removeEventSource(_cmdGate);
_cmdGate->release();
_cmdGate = 0;
}
if (_buttonTimer)
{
pWorkLoop->removeEventSource(_buttonTimer);
_buttonTimer->release();
_buttonTimer = 0;
}
}
//
// Uninstall the interrupt handler.
//
if ( _interruptHandlerInstalled ) _device->uninstallInterruptAction();
_interruptHandlerInstalled = false;
//
// Uninstall the power control handler.
//
if ( _powerControlHandlerInstalled ) _device->uninstallPowerControlAction();
_powerControlHandlerInstalled = false;
//
// Uinstall message handler.
//
if (_messageHandlerInstalled)
{
_device->uninstallMessageAction();
_messageHandlerInstalled = false;
}
//
// Release the pointer to the provider object.
//
OSSafeReleaseNULL(_device);;
super::stop(provider);
}
示例15: stop
void BrcmPatchRAM::stop(IOService* provider)
{
#ifdef DEBUG
uint64_t stop_time, nano_secs;
clock_get_uptime(&stop_time);
absolutetime_to_nanoseconds(stop_time - wake_time, &nano_secs);
uint64_t milli_secs = nano_secs / 1000000;
AlwaysLog("Time since wake %llu.%llu seconds.\n", milli_secs / 1000, milli_secs % 1000);
#endif
DebugLog("stop\n");
#if 0
#ifndef TARGET_ELCAPITAN
//REVIEW: so kext can be unloaded with kextunload -p
// unload native bluetooth driver
IOReturn result = gIOCatalogue->terminateDriversForModule(brcmBundleIdentifier, false);
if (result != kIOReturnSuccess)
AlwaysLog("[%04x:%04x]: failure terminating native Broadcom bluetooth (%08x)\n", mVendorId, mProductId, result);
else
DebugLog("[%04x:%04x]: success terminating native Broadcom bluetooth\n", mVendorId, mProductId);
// unpublish native bluetooth personality
removePersonality();
#endif
#endif
mStopping = true;
// allow firmware load already started to finish
IOLockLock(mLoadFirmwareLock);
OSSafeReleaseNULL(mFirmwareStore);
IOWorkLoop* workLoop = getWorkLoop();
if (workLoop)
{
if (mTimer)
{
mTimer->cancelTimeout();
workLoop->removeEventSource(mTimer);
mTimer->release();
mTimer = NULL;
}
if (mWorkSource)
{
workLoop->removeEventSource(mWorkSource);
mWorkSource->release();
mWorkSource = NULL;
mWorkPending = 0;
}
}
PMstop();
if (mCompletionLock)
{
IOLockFree(mCompletionLock);
mCompletionLock = NULL;
}
#ifndef NON_RESIDENT
if (mWorkLock)
{
IOLockFree(mWorkLock);
mWorkLock = NULL;
}
IOLockUnlock(mLoadFirmwareLock);
#endif // #ifndef NON_RESIDENT
mDevice.setDevice(NULL);
mStopping = false;
super::stop(provider);
}