op_prg_mt_mutex_destroy()

Abstract

Destroys a mutex.

Syntax

op_prg_mt_mutex_destroy (mutex_ptr)
Argument Type Description
mutex_ptr PrgT_Mutex * Mutex to be destroyed.

Return Type

Compcode

OPC_COMPCODE_SUCCESS if the mutex is destroyed; OPC_COMPCODE_FAILURE if the mutex pointer is null or the mutex is locked.

Example

/* Create the mutex that will be used to serialize calling of prg_mapping */
/* functions, which read/write global model related mapping information,  */
/* under multithreaded execution with multiple CPUs. */
mapping_info_mutex = op_prg_mt_mutex_create (OPC_MT_MUTEX_READER_WRITER, 0,
	"WLAN Mapping Info Mutex");

. . .

/* Mutex for prg_mapping functions no longer needed. */
op_prg_mt_mutex_destroy (mapping_info_mutex);

Details

A mutex should be destroyed when it is no longer needed to serialize access to data. A mutex must be unlocked before it can be destroyed. If you try to destroy an locked mutex, the operation will fail and a recoverable error will be generated.

Purpose

Provides a way to destroy an unneeded mutex and free the associated memory.

Errors

  • Recoverable Error: Null mutex pointer
  • Recoverable Error: Mutex (<description>) is currently locked by Objid (<lock_objid>)

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