RtReleaseInterrupt

RtReleaseInterrupt releases an interrupt previously attached using RtAttachInterrupt. This breaks the association between a user's interrupt handling routine and the hardware interrupt.

NOTE: RtReleaseInterrupt is only supported in the RTSS environment. It cannot be called from a Windows application linked to RTX64.

Syntax

BOOL RtReleaseInterrupt(
    HANDLE hInterrupt
);

Parameters

hInterrupt

An RTX64-specific handle as returned by a preceding call to RtAttachInterrupt.

Return Value

TRUE if the function succeeds, FALSE if the argument was invalid or the operation on the handle did not succeed

Remarks

RtReleaseInterrupt breaks the association between a device interrupt and the user's handling routine. For line-based interrupts or message-based single vector interrupts, the user should take care to disable interrupt generation on the hardware device before making a call to this routine. Typically, this is done by writing to the command register of the device.

Unlike driver unloading, an RTX64 application can exit and leave a device enabled, with the device attempting to deliver interrupts to the handling thread. Although the RTX64 library usually cleans up after an application exits, there are times when the exiting application can bypass the library's attempt to detect the exit. To avoid such a condition, use RtReleaseInterrupt; it will release a previously attached interrupt.

Note: Just as in an interrupt service routine in a device driver, a real-time application must be able to acknowledge an interrupt and control the device that generated it. For further details on communicating with devices, see Physical Memory Mapping and Port IO.

Requirements

Minimum Supported Version

RTX64 3.3 for Multiple Vector Interrupts

RTX64 2013 for line-based interrupts and message-based single vector interrupts

Header Rtapi.h
Library Rtx_Rtss.lib

Example

See the IntelPro1000 topic for information on an example that uses the RtReleaseInterrupt function.

See Also:

RtAttachInterrupt