⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pgprmwolock.h

📁 vc环境下的pgp源码
💻 H
字号:
/*____________________________________________________________________________
	Copyright (C) 1997 Network Associates Inc. and affiliated companies.
	All rights reserved.
	
	
	
	$Id: pgpRMWOLock.h,v 1.9 1999/03/10 02:54:45 heller Exp $
____________________________________________________________________________*/

#ifndef Included_pgpRMWOLock_h	/* [ */
#define Included_pgpRMWOLock_h

#if PGP_WIN32
# include <windows.h>
#endif

#include "pgpTypes.h"
#include "pgpThreads.h"

PGP_BEGIN_C_DECLARATIONS

/* These files implement a Read Many/Write Once lock. To use, simply
initialize a lock for the resource and surround your reading and writing of it
with the appropriate calls. */

#if PGP_UNIX_SOLARIS	/* solaris has a system impl. of this */
 typedef rwlock_t PGPRMWOLock;
#elif PGP_MACINTOSH
	typedef char PGPRMWOLock;
#else
 typedef struct PGPRMWOLock {
	PGPMutex_t	mutex;
	PGPSem_t	blockedReaders;
	PGPSem_t	blockedWriters;
	PGPUInt16	activeReaders;
	PGPUInt16	waitingReader;
	PGPUInt16	activeWriters;
	PGPUInt16	waitingWriter;
 } PGPRMWOLock;
#endif

#if PGP_MACINTOSH

# define InitializePGPRMWOLock(x)
# define DeletePGPRMWOLock(x)
# define PGPRMWOLockStartReading(x)
# define PGPRMWOLockStopReading(x)
# define PGPRMWOLockStartWriting(x)
# define PGPRMWOLockStopWriting(x)

#else

void	InitializePGPRMWOLock(PGPRMWOLock * inLock);
void	DeletePGPRMWOLock(PGPRMWOLock * inLock);
void	PGPRMWOLockStartReading(PGPRMWOLock * inLock);
void	PGPRMWOLockStopReading(PGPRMWOLock * inLock);
void	PGPRMWOLockStartWriting(PGPRMWOLock * inLock);
void	PGPRMWOLockStopWriting(PGPRMWOLock * inLock);

#endif /* PGP_MACINTOSH */

PGP_END_C_DECLARATIONS

#endif /* ] Included_pgpRMWOLock_h */

⌨️ 快捷键说明

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