op_prg_mt_global_unlock()

摘要

解锁全局互斥锁。

语法

op_prg_mt_global_unlock ()
参数 类型 说明
无参数

返回类型

Compcode

若全局互斥锁解锁成功,返回 OPC_COMPCODE_SUCCESS;否则返回 OPC_COMPCODE_FAILURE。

示例

/* Unless it is already done, initialize the receiver */
/* channel's state information. */
if (op_ima_obj_state_get (rx_obid) == OPC_NIL)
	{
	/* Channel state information doesn't exist. Lock */
	/* the global mutex before continuing. */
	op_prg_mt_global_lock ();

	/* Check again, because another thread may have */
	/* already set up the state information. */
	if (op_ima_obj_state_get (rx_obid) == OPC_NIL)
		{
		/* Create and set the initial state information */
		/* for the receiver channel. */
		rxch_state_ptr = (DraT_Rxch_State_Info *)
			op_prg_mem_alloc (sizeof (DraT_Rxch_State_Info));
		rxch_state_ptr->signal_lock = OPC_FALSE;
		op_ima_obj_state_set (rx_obid, rxch_state_ptr);
		}

	/* Unlock the global mutex. */
	op_prg_mt_global_unlock ();
	}

详情

无。

用途

提供了一种解锁全局互斥锁的方法。

错误

  • 可恢复错误:互斥锁指针为空
  • 可恢复错误:互斥锁(prg_global_mutex)未被本线程锁定

参考

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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