blob: 18061aee1329e4052dca26f210548038bae90c42 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
/** BEGIN COPYRIGHT BLOCK
* Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
* Copyright (C) 2005 Red Hat, Inc.
* All rights reserved.
* END COPYRIGHT BLOCK **/
#ifndef _RWLOCK_H_
#define _RWLOCK_H_
#include <prlock.h>
#include <prcvar.h>
typedef struct _rwl {
PRLock *rwl_readers_mutex;
PRLock *rwl_writers_mutex;
PRCondVar *rwl_writer_waiting_cv;
int rwl_num_readers;
int rwl_writer_waiting;
int (*rwl_acquire_read_lock)( struct _rwl * );
int (*rwl_relinquish_read_lock)( struct _rwl * );
int (*rwl_acquire_write_lock)( struct _rwl * );
int (*rwl_relinquish_write_lock)( struct _rwl * );
} rwl;
extern rwl *rwl_new();
extern void rwl_free( rwl **rh );
#endif /* _RWLOCK_H_ */
|