/usr/include/audio/mutex.h is in libaudio-dev 1.9.4-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | /*
* mutexes for libaudio
*
* Jon Trulson, 11/25/2001
*
* $Id: mutex.h 87 2002-02-24 04:39:08Z jon $
*
*/
/*
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of M.I.T. not be used in advertising or
publicity pertaining to distribution of the software without specific,
written prior permission. M.I.T. makes no representations about the
suitability of this software for any purpose. It is provided "as is"
without express or implied warranty.
*/
#include "NasConfig.h" /* see if we should try to use mutexes */
#ifndef _MUTEX_H_INCLUDED
#define _MUTEX_H_INCLUDED
/*JET*/
/*#define DEBUG_MUTEX*/
#ifdef DEBUG_MUTEX
# define MDBG_START(x) fprintf(stderr, "%s: %s@%d ...", x, __FILE__, __LINE__);
# define MDBG_END() fprintf(stderr, "done\n");
#else
# define MDBG_START(x)
# define MDBG_END()
#endif
#include <audio/audiolib.h>
#include <stdio.h>
#include <errno.h>
#include <audio/Aproto.h>
#include <audio/Afuncs.h>
#include <audio/Aosdefs.h>
/* NAS_USEMTSAFEAPI is defined in config/NasConfig.h. If undefined
thread safety will be disabled */
#if defined(XTHREADS) && defined(NAS_USEMTSAFEAPI)
# include <X11/Xthreads.h>
typedef xmutex_rec _AuMutex;
# ifndef XMUTEX_INITIALIZER
/* These systems don't seem to define
XMUTEX_INITIALIZER, even though they
should */
# if defined(SVR4) && (defined(USL) || defined(sun))
# define XMUTEX_INITIALIZER {0}
# else
# define XMUTEX_INITIALIZER 0
# endif
# endif
# define _AU_MUTEX_INITIALIZER XMUTEX_INITIALIZER
#else
typedef unsigned int _AuMutex;
# define _AU_MUTEX_INITIALIZER 0
#endif
#ifdef _INSTANTIATE_GLOBALS
_AuMutex _serv_mutex = _AU_MUTEX_INITIALIZER;
_AuMutex _init_mutex = _AU_MUTEX_INITIALIZER;
#else
extern _AuMutex _serv_mutex;
extern _AuMutex _init_mutex;
#endif
/* NAS_USEMTSAFEAPI is defined in config/NasConfig.h. If undefined
thread safety will be disabled */
#if defined(XTHREADS) && defined(NAS_USEMTSAFEAPI)
#define _AuLockServer() { \
MDBG_START("LOCK _serv_mutex"); \
xmutex_lock(&_serv_mutex); \
MDBG_END(); \
}
#define _AuUnlockServer() { \
MDBG_START("UNLOCK _serv_mutex"); \
xmutex_unlock(&_serv_mutex); \
MDBG_END(); \
}
#define _AuLockMutex(x) { \
MDBG_START("LOCK mutex"); \
xmutex_lock(&(x)); \
MDBG_END(); \
}
#define _AuUnlockMutex(x) { \
MDBG_START("UNLOCK mutex"); \
xmutex_unlock(&(x)); \
MDBG_END(); \
}
#else
#define _AuLockServer()
#define _AuUnlockServer()
#define _AuLockMutex(x)
#define _AuUnlockMutex(x)
#endif
#endif /* _MUTEX_H_INCLUDED */
|