1 /* This file is part of the Zebra server.
2 Copyright (C) 1994-2010 Index Data
4 Zebra is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
9 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 #include <yaz/yconfig.h>
38 CRITICAL_SECTION mutex;
40 # if YAZ_POSIX_THREADS
41 pthread_mutex_t mutex;
49 YAZ_EXPORT int zebra_mutex_init (Zebra_mutex *p);
50 YAZ_EXPORT int zebra_mutex_destroy (Zebra_mutex *p);
51 YAZ_EXPORT int zebra_mutex_lock (Zebra_mutex *p);
52 YAZ_EXPORT int zebra_mutex_unlock (Zebra_mutex *p);
58 pthread_mutex_t mutex;
59 pthread_cond_t lock_free;
63 YAZ_EXPORT int zebra_lock_rdwr_init (Zebra_lock_rdwr *p);
64 YAZ_EXPORT int zebra_lock_rdwr_destroy (Zebra_lock_rdwr *p);
65 YAZ_EXPORT int zebra_lock_rdwr_rlock (Zebra_lock_rdwr *p);
66 YAZ_EXPORT int zebra_lock_rdwr_wlock (Zebra_lock_rdwr *p);
67 YAZ_EXPORT int zebra_lock_rdwr_runlock (Zebra_lock_rdwr *p);
68 YAZ_EXPORT int zebra_lock_rdwr_wunlock (Zebra_lock_rdwr *p);
72 pthread_mutex_t mutex;
79 YAZ_EXPORT int zebra_mutex_cond_init (Zebra_mutex_cond *p);
80 YAZ_EXPORT int zebra_mutex_cond_destroy (Zebra_mutex_cond *p);
81 YAZ_EXPORT int zebra_mutex_cond_lock (Zebra_mutex_cond *p);
82 YAZ_EXPORT int zebra_mutex_cond_unlock (Zebra_mutex_cond *p);
83 YAZ_EXPORT int zebra_mutex_cond_wait (Zebra_mutex_cond *p);
84 YAZ_EXPORT int zebra_mutex_cond_signal (Zebra_mutex_cond *p);
92 * c-file-style: "Stroustrup"
93 * indent-tabs-mode: nil
95 * vim: shiftwidth=4 tabstop=8 expandtab