1 /*****************************************************************************
2 * threads.c : threads implementation for the VideoLAN client
3 *****************************************************************************
4 * Copyright (C) 1999-2008 VLC authors and VideoLAN
7 * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
8 * Samuel Hocevar <sam@zoy.org>
9 * Gildas Bazin <gbazin@netcourrier.com>
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU Lesser General Public License as published by
15 * the Free Software Foundation; either version 2.1 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License for more details.
23 * You should have received a copy of the GNU Lesser General Public License
24 * along with this program; if not, write to the Free Software Foundation,
25 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26 *****************************************************************************/
32 #include <vlc_common.h>
35 /*** Global locks ***/
37 void vlc_global_mutex (unsigned n
, bool acquire
)
39 static vlc_mutex_t locks
[] = {
46 static_assert (VLC_MAX_MUTEX
== (sizeof (locks
) / sizeof (locks
[0])),
47 "Wrong number of global mutexes");
48 assert (n
< (sizeof (locks
) / sizeof (locks
[0])));
50 vlc_mutex_t
*lock
= locks
+ n
;
52 vlc_mutex_lock (lock
);
54 vlc_mutex_unlock (lock
);