Delete libpthread-map.
[kopensolaris-gnu/glibc.git] / linuxthreads / spinlock.h
1 /* Linuxthreads - a simple clone()-based implementation of Posix        */
2 /* threads for Linux.                                                   */
3 /* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) and          */
4 /* Richard Henderson (rth@tamu.edu)                                     */
5 /*                                                                      */
6 /* This program is free software; you can redistribute it and/or        */
7 /* modify it under the terms of the GNU Library General Public License  */
8 /* as published by the Free Software Foundation; either version 2       */
9 /* of the License, or (at your option) any later version.               */
10 /*                                                                      */
11 /* This program is distributed in the hope that it will be useful,      */
12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of       */
13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        */
14 /* GNU Library General Public License for more details.                 */
15
16 /* Spin locks */
17
18 extern void __pthread_acquire(int * spinlock);
19
20 static inline void acquire(int * spinlock)
21 {
22   if (testandset(spinlock)) __pthread_acquire(spinlock);
23 }
24
25 static inline void release(int * spinlock)
26 {
27 #ifndef RELEASE
28   *spinlock = 0;
29 #else
30   RELEASE(spinlock);
31 #endif
32 }