rvmon_.h

来自「h.248协议源码」· C头文件 代码 · 共 57 行

H
57
字号
#if (0)
******************************************************************************
Filename   :
Description:
******************************************************************************
                Copyright (c) 1999 RADVision Inc.
************************************************************************
NOTICE:
This document contains information that is proprietary to RADVision LTD.
No part of this publication may be reproduced in any form whatsoever 
without written prior approval by RADVision LTD..

RADVision LTD. reserves the right to revise this publication and make 
changes without obligation to notify any person of such revisions or 
changes.
******************************************************************************
$Revision:$
$Date:$
$Author: S. Cipolli$
******************************************************************************
#endif

#ifndef RV_MON__H
#define RV_MON__H

#include "rvsem_.h"

/* Monitor interface */
/* A monitor allows threads to wait for an event notification while holding	*/
/* exclusive access to a resource.  While the thread waits, it atomically	*/
/* gives up exclusive access and atomically regains exclusive access upon	*/
/* reawakening (due to an event rvCondNotify[All]).						*/
/* For further information see:												*/
/* "Monitors: An Operating System Structuring Concept" by C.A.R. Hoare		*/
/* Communications of the ACM, October 1974 (Vol. 17, No. 10), pp 549-557	*/
typedef struct {
	RvSem_ mutex;		/* Mutual exclusion */
	RvSem_ urgent;		/* Holds notifying threads pending for monitor */
	int count;			/* Number of notifiers waiting */
} RvMon_;

#if defined(__cplusplus)
extern "C" {
#endif

RvMon_* rvMonConstruct_(RvMon_ *m);
void rvMonDestruct_(RvMon_ *m);
#define rvMonLock_(m)				(rvSemWait_(&(m)->mutex))
void rvMonUnlock_(RvMon_ *m);

#if defined(__cplusplus)
}
#endif

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?