#ifndef DONE_RWLOCK
#include "thread.h"
#define DONE_RWLOCK 1
typedef struct RWLOCK {char *name; int nref; int exclusive; int held; o_thread hid; time_t start; struct RWLOCK *next;} Rwlock;

int rwlock_release(Rwlock *me);
Rwlock *rwlock_wait(char *obj, int timeout, int exclusive, int line, int *held, o_thread *hid, int *age);
int rwlock_set_mutex(int (*cb)(int vm, int isget, int seconds), int m);
void rwlock_init(void);
Rwlock *rwlock_wait_simple(char *obj, int timeout, int exclusive);
#endif
