Changes from arch/CVS synchronization
[bpt/guile.git] / libguile / pthread-threads.h
CommitLineData
eac85310
MV
1/* classes: h_files */
2
9de87eea
MV
3#ifndef SCM_PTHREADS_THREADS_H
4#define SCM_PTHREADS_THREADS_H
eac85310 5
2b829bbb 6/* Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
eac85310 7 *
73be1d9e
MV
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
eac85310 12 *
73be1d9e 13 * This library is distributed in the hope that it will be useful,
eac85310 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
73be1d9e
MV
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
eac85310 17 *
73be1d9e
MV
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
92205699 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
73be1d9e 21 */
eac85310
MV
22
23\f
24
9bc4701c 25/* The pthreads-threads implementation. This is a direct mapping.
eac85310
MV
26*/
27
28#include <pthread.h>
0b6843b1 29#include <sched.h>
eac85310 30
9de87eea
MV
31/* Threads
32*/
33#define scm_i_pthread_t pthread_t
34#define scm_i_pthread_self pthread_self
35#define scm_i_pthread_create pthread_create
36#define scm_i_pthread_detach pthread_detach
37#define scm_i_pthread_exit pthread_exit
38#define scm_i_sched_yield sched_yield
39
40/* Signals
9bc4701c 41 */
9de87eea 42#define scm_i_pthread_sigmask pthread_sigmask
9bc4701c 43
9de87eea
MV
44/* Mutexes
45 */
46#define SCM_I_PTHREAD_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
9de87eea
MV
47#define scm_i_pthread_mutex_t pthread_mutex_t
48#define scm_i_pthread_mutex_init pthread_mutex_init
49#define scm_i_pthread_mutex_destroy pthread_mutex_destroy
50#define scm_i_pthread_mutex_trylock pthread_mutex_trylock
51#define scm_i_pthread_mutex_lock pthread_mutex_lock
52#define scm_i_pthread_mutex_unlock pthread_mutex_unlock
d1138028 53extern pthread_mutexattr_t scm_i_pthread_mutexattr_recursive[1];
9de87eea
MV
54
55/* Condition variables
56 */
57#define SCM_I_PTHREAD_COND_INITIALIZER PTHREAD_COND_INITIALIZER
58#define scm_i_pthread_cond_t pthread_cond_t
59#define scm_i_pthread_cond_init pthread_cond_init
60#define scm_i_pthread_cond_destroy pthread_cond_destroy
61#define scm_i_pthread_cond_signal pthread_cond_signal
62#define scm_i_pthread_cond_broadcast pthread_cond_broadcast
63#define scm_i_pthread_cond_wait pthread_cond_wait
64#define scm_i_pthread_cond_timedwait pthread_cond_timedwait
65
66/* Onces
67 */
68#define scm_i_pthread_once_t pthread_once_t
9de87eea 69#define scm_i_pthread_once pthread_once
8ab3d8a0
KR
70#if SCM_NEED_BRACES_ON_PTHREAD_ONCE_INIT
71#define SCM_I_PTHREAD_ONCE_INIT { PTHREAD_ONCE_INIT }
72#else
73#define SCM_I_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
74#endif
eac85310 75
9de87eea
MV
76/* Thread specific storage
77 */
78#define scm_i_pthread_key_t pthread_key_t
79#define scm_i_pthread_key_create pthread_key_create
80#define scm_i_pthread_setspecific pthread_setspecific
81#define scm_i_pthread_getspecific pthread_getspecific
e29e0b09 82
9de87eea
MV
83/* Convenience functions
84 */
85#define scm_i_scm_pthread_mutex_lock scm_pthread_mutex_lock
661ae7ab 86#define scm_i_dynwind_pthread_mutex_lock scm_dynwind_pthread_mutex_lock
9de87eea
MV
87#define scm_i_scm_pthread_cond_wait scm_pthread_cond_wait
88#define scm_i_scm_pthread_cond_timedwait scm_pthread_cond_timedwait
28d52ebb 89
9de87eea 90#endif /* SCM_PTHREADS_THREADS_H */
eac85310
MV
91
92/*
93 Local Variables:
94 c-file-style: "gnu"
95 End:
96*/