diff options
author | cvsadm <cvsadm> | 2005-01-21 00:44:34 +0000 |
---|---|---|
committer | cvsadm <cvsadm> | 2005-01-21 00:44:34 +0000 |
commit | b2093e3016027d6b5cf06b3f91f30769bfc099e2 (patch) | |
tree | cf58939393a9032182c4fbc4441164a9456e82f8 /include/base/rwlock.h | |
download | ds-ldapserver7x.tar.gz ds-ldapserver7x.tar.xz ds-ldapserver7x.zip |
Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. (foxworth)ldapserver7x
Diffstat (limited to 'include/base/rwlock.h')
-rw-r--r-- | include/base/rwlock.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/include/base/rwlock.h b/include/base/rwlock.h new file mode 100644 index 00000000..2111e97b --- /dev/null +++ b/include/base/rwlock.h @@ -0,0 +1,54 @@ +/** BEGIN COPYRIGHT BLOCK + * Copyright 2001 Sun Microsystems, Inc. + * Portions copyright 1999, 2001-2003 Netscape Communications Corporation. + * All rights reserved. + * END COPYRIGHT BLOCK **/ +/* + * rwlock.h: Shared/Exclusive lock abstraction. + * + * Sanjay Krishnamurthi + */ +#ifndef _BASE_RWLOCK_H_ +#define _BASE_RWLOCK_H_ + +#include "netsite.h" +#include "crit.h" + +NSPR_BEGIN_EXTERN_C + +typedef void* RWLOCK; + +/* + * rwlock_Init() + * creates and returns a new readwrite lock variable. + */ +NSAPI_PUBLIC RWLOCK rwlock_Init(void); + +/* + * rwlock_ReadLock() + */ +NSAPI_PUBLIC void rwlock_ReadLock(RWLOCK lock); + +/* + * rwlock_WriteLock() + */ +NSAPI_PUBLIC void rwlock_WriteLock(RWLOCK lock); + +/* + * rwlock_Unlock() + */ +NSAPI_PUBLIC void rwlock_Unlock(RWLOCK lock); + +/* + * rwlock_DemoteLock() + */ +NSAPI_PUBLIC void rwlock_DemoteLock(RWLOCK lock); + +/* + * rwlock_terminate removes a previously allocated RWLOCK variable. + */ +NSAPI_PUBLIC void rwlock_Terminate(RWLOCK lock); + +NSPR_END_EXTERN_C + +#endif /* _BASE_RWLOCK_H_ */ |