]>
Commit | Line | Data |
---|---|---|
6d412a7b VC |
1 | /* Threads compatibility routines for libgcc2. */ |
2 | /* Compile this one with gcc. */ | |
3 | /* Copyright (C) 2003 Free Software Foundation, Inc. | |
4 | ||
5 | This file is part of GCC. | |
6 | ||
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 2, or (at your option) any later | |
10 | version. | |
11 | ||
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 | |
15 | for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with GCC; see the file COPYING. If not, write to the Free | |
19 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA | |
20 | 02111-1307, USA. */ | |
21 | ||
22 | /* As a special exception, if you link this library with other files, | |
23 | some of which are compiled with GCC, to produce an executable, | |
24 | this library does not by itself cause the resulting executable | |
25 | to be covered by the GNU General Public License. | |
26 | This exception does not however invalidate any other reasons why | |
27 | the executable file might be covered by the GNU General Public License. */ | |
28 | ||
29 | ||
30 | #include "gthr-gnat.h" | |
31 | ||
32 | #ifdef __cplusplus | |
33 | #define UNUSED(x) | |
34 | #else | |
35 | #define UNUSED(x) x __attribute__((unused)) | |
36 | #endif | |
37 | ||
38 | void | |
39 | __gnat_default_lock (void) | |
40 | { | |
41 | return; | |
42 | } | |
43 | ||
44 | void | |
45 | __gnat_default_unlock (void) | |
46 | { | |
47 | return; | |
48 | } | |
49 | ||
50 | static void (*__gnat_task_lock) () = *__gnat_default_lock; | |
51 | static void (*__gnat_task_unlock) () = *__gnat_default_unlock; | |
52 | ||
53 | void | |
54 | __gnat_install_locks (lock, unlock) | |
55 | void (*lock) (); | |
56 | void (*unlock) (); | |
57 | { | |
58 | __gnat_task_lock = lock; | |
59 | __gnat_task_unlock = unlock; | |
60 | ||
61 | } | |
62 | ||
63 | int | |
64 | __gthread_active_p (void) | |
65 | { | |
66 | return 0; | |
67 | } | |
68 | ||
69 | int | |
70 | __gthread_mutex_lock (__gthread_mutex_t * UNUSED (mutex)) | |
71 | { | |
72 | __gnat_task_lock (); | |
73 | return 0; | |
74 | } | |
75 | ||
76 | int | |
77 | __gthread_mutex_unlock (__gthread_mutex_t * UNUSED (mutex)) | |
78 | { | |
79 | __gnat_task_unlock (); | |
80 | return 0; | |
81 | } | |
82 | ||
83 | #undef UNUSED | |
84 |