op_intrpt_clear_self()

Abstract

Cancels all self interrupts pending for the invoking process.

Syntax

op_intrpt_clear_self ()
Argument Type Description
no arguments

Return Type

void

no return value

Example

Excerpt from: example model (models/std/hssb); process model (hssb_link_mac); state (READY); exit execs.

else if (((op_intrpt_type() == OPC_INTRPT_STAT) &&
	(op_intrpt_stat() == SWIRE_FROM_LINK_PKTQ_SZ)) ||
	((op_intrpt_type() == OPC_INTRPT_SELF) &&
	(op_intrpt_code() == PACKET_READY)))
	{
	/* A packet is ready to be */
	/* xmitted. Try to win arbitration. */
	arb_status = UNSET;
	go_to_arb = TRUE;

	/* Clear the self intrpts. */
	op_intrpt_clear_self ();
	}

Details

This KP will remove all self interrupts that have been previously scheduled by the invoking process for itself. Invoking this KP is equivalent to invoking op_ev_cancel() once for every pending self interrupt. However, since no event handles are required to identify the interrupts to be cancelled, this KP can also be used as a convenient replacement for a single invocation of op_ev_cancel() when only one self interrupt is pending (note however, that this is significantly less efficient than invoking op_ev_cancel() for the particular event handle of interest).

Self interrupts that are pending for other processes within the current module are unaffected.

Purpose

Provides a mechanism for “pulling back” all self interrupts. In its role as a convenient alternative to op_ev_cancel(), this KP can be used for the same purposes (such applications depend on the fact that only one self interrupt is pending). A unique use for this KP arises when an interrupt causes a process to decide that its current course of actions must be stopped, and several sequencing self interrupts that were scheduled in the context of the prior course of actions are no longer necessary. In such a situation, all pending self interrupts can be swept clean by invoking this KP.

Errors

  • Program Abort: KP requires process context.

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com