IWDFInterrupt::TryToAcquireInterruptLock method

The TryToAcquireInterruptLock method acquires the interrupt lock if no other thread has already acquired it.

Syntax


BOOLEAN TryToAcquireInterruptLock();

Parameters

This method has no parameters.

Return value

The method returns TRUE if the interrupt lock was successfully acquired. Otherwise, the method returns FALSE.

Remarks

Unlike IWDFInterrupt::AcquireInterruptLock, IWDFInterrupt::TryToAcquireInterruptLock does not wait for the interrupt lock to become available if another thread is holding it.

When running in an arbitrary thread, such as an I/O queue callback method, drivers must call IWDFInterrupt::TryToAcquireInterruptLock instead of IWDFInterrupt::AcquireInterruptLock. For example, the driver calls IWDFInterrupt::TryToAcquireInterruptLock from IQueueCallbackRead::OnRead. Doing so avoids the possibility of deadlock, as described in the Remarks section of IWDFInterrupt::AcquireInterruptLock.

The driver must not attempt to acquire the lock recursively. If connected to the debugger, the framework introduces a breakpoint in this scenario.

For more information about manual interrupt locking, see Synchronizing Interrupt Code.

For more information about handling interrupts in UMDF drivers, see Accessing Hardware and Handling Interrupts.

Requirements

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.11

Header

Wudfddi.h

DLL

WUDFx.dll

See also

IWDFInterrupt
IWDFInterrupt::AcquireInterruptLock
WdfInterruptTryToAcquireLock

 

 

Send comments about this topic to Microsoft

표시:
© 2014 Microsoft