source: trunk/src/3rdparty/ptmalloc/sysdeps/sproc/malloc-machine.h

Last change on this file was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 1.9 KB
Line 
1/* Basic platform-independent macro definitions for mutexes,
2 thread-specific data and parameters for malloc.
3 SGI threads (sprocs) version.
4 Copyright (C) 2004 Wolfram Gloger <wg@malloc.de>.
5
6Permission to use, copy, modify, distribute, and sell this software
7and its documentation for any purpose is hereby granted without fee,
8provided that (i) the above copyright notices and this permission
9notice appear in all copies of the software and related documentation,
10and (ii) the name of Wolfram Gloger may not be used in any advertising
11or publicity relating to the software.
12
13THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
14EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
15WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
16
17IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL,
18INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
19DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY
21OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22PERFORMANCE OF THIS SOFTWARE.
23*/
24
25#ifndef _SPROC_MALLOC_MACHINE_H
26#define _SPROC_MALLOC_MACHINE_H
27
28#include <sys/wait.h>
29#include <sys/types.h>
30#include <sys/prctl.h>
31#include <abi_mutex.h>
32
33typedef abilock_t mutex_t;
34
35#define MUTEX_INITIALIZER { 0 }
36#define mutex_init(m) init_lock(m)
37#define mutex_lock(m) (spin_lock(m), 0)
38#define mutex_trylock(m) acquire_lock(m)
39#define mutex_unlock(m) release_lock(m)
40
41typedef int tsd_key_t;
42int tsd_key_next;
43#define tsd_key_create(key, destr) ((*key) = tsd_key_next++)
44#define tsd_setspecific(key, data) (((void **)(&PRDA->usr_prda))[key] = data)
45#define tsd_getspecific(key, vptr) (vptr = ((void **)(&PRDA->usr_prda))[key])
46
47#define thread_atfork(prepare, parent, child) do {} while(0)
48
49#include <sysdeps/generic/malloc-machine.h>
50
51#endif /* !defined(_SPROC_MALLOC_MACHINE_H) */
Note: See TracBrowser for help on using the repository browser.