1 /* Threads compatibility routines for libgcc2. */
2 /* Compile this one with gcc. */
3 /* Copyright (C) 2003, 2004, 2009 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC 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 3, or (at your option) any later
12 GCC 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 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
26 #include "gthr-gnat.h"
29 #pragma GCC visibility push(default)
35 #define UNUSED(x) x __attribute__((unused))
38 void __gnat_default_lock (void);
39 void __gnat_default_unlock (void);
42 __gnat_default_lock (void)
48 __gnat_default_unlock (void)
53 static void (*__gnat_task_lock
) (void) = *__gnat_default_lock
;
54 static void (*__gnat_task_unlock
) (void) = *__gnat_default_unlock
;
57 __gnat_install_locks (void (*lock
) (void), void (*unlock
) (void))
59 __gnat_task_lock
= lock
;
60 __gnat_task_unlock
= unlock
;
64 __gthread_active_p (void)
70 __gthread_mutex_lock (__gthread_mutex_t
* UNUSED (mutex
))
77 __gthread_mutex_unlock (__gthread_mutex_t
* UNUSED (mutex
))
79 __gnat_task_unlock ();
84 #pragma GCC visibility pop