1 /* $Id: zebra-lock.h,v 1.8 2005-01-15 19:38:24 adam Exp $
2 Copyright (C) 1995-2005
5 This file is part of the Zebra server.
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with Zebra; see the file LICENSE.zebra. If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
35 #include <yaz/yconfig.h>
41 CRITICAL_SECTION mutex;
43 # if YAZ_POSIX_THREADS
44 pthread_mutex_t mutex;
52 YAZ_EXPORT int zebra_mutex_init (Zebra_mutex *p);
53 YAZ_EXPORT int zebra_mutex_destroy (Zebra_mutex *p);
54 YAZ_EXPORT int zebra_mutex_lock (Zebra_mutex *p);
55 YAZ_EXPORT int zebra_mutex_unlock (Zebra_mutex *p);
61 pthread_mutex_t mutex;
62 pthread_cond_t lock_free;
66 YAZ_EXPORT int zebra_lock_rdwr_init (Zebra_lock_rdwr *p);
67 YAZ_EXPORT int zebra_lock_rdwr_destroy (Zebra_lock_rdwr *p);
68 YAZ_EXPORT int zebra_lock_rdwr_rlock (Zebra_lock_rdwr *p);
69 YAZ_EXPORT int zebra_lock_rdwr_wlock (Zebra_lock_rdwr *p);
70 YAZ_EXPORT int zebra_lock_rdwr_runlock (Zebra_lock_rdwr *p);
71 YAZ_EXPORT int zebra_lock_rdwr_wunlock (Zebra_lock_rdwr *p);
75 pthread_mutex_t mutex;
82 YAZ_EXPORT int zebra_mutex_cond_init (Zebra_mutex_cond *p);
83 YAZ_EXPORT int zebra_mutex_cond_destroy (Zebra_mutex_cond *p);
84 YAZ_EXPORT int zebra_mutex_cond_lock (Zebra_mutex_cond *p);
85 YAZ_EXPORT int zebra_mutex_cond_unlock (Zebra_mutex_cond *p);
86 YAZ_EXPORT int zebra_mutex_cond_wait (Zebra_mutex_cond *p);
87 YAZ_EXPORT int zebra_mutex_cond_signal (Zebra_mutex_cond *p);