78 |
#define scm_i_plugin_mutex_trylock pthread_mutex_trylock |
#define scm_i_plugin_mutex_trylock pthread_mutex_trylock |
79 |
#define scm_i_plugin_mutex_unlock pthread_mutex_unlock |
#define scm_i_plugin_mutex_unlock pthread_mutex_unlock |
80 |
|
|
81 |
|
/* Size is checked in scm_init_pthread_threads */ |
82 |
#define SCM_REC_MUTEX_MAXSIZE (8 * sizeof (long)) |
#define SCM_REC_MUTEX_MAXSIZE (8 * sizeof (long)) |
83 |
typedef struct { char _[SCM_REC_MUTEX_MAXSIZE]; } scm_t_rec_mutex; |
typedef struct { char _[SCM_REC_MUTEX_MAXSIZE]; } scm_t_rec_mutex; |
84 |
|
|
85 |
extern scm_t_mutexattr scm_i_plugin_rec_mutex; |
extern scm_t_mutexattr scm_i_plugin_rec_mutex; |
86 |
|
|
87 |
#ifdef PTHREAD_MUTEX_RECURSIVE /* pthreads has recursive mutexes! */ |
#ifdef SCM_MUTEX_RECURSIVE /* pthreads has recursive mutexes! */ |
88 |
#define scm_i_plugin_rec_mutex_init pthread_mutex_init |
#define scm_i_plugin_rec_mutex_init(m,a) \ |
89 |
#define scm_i_plugin_rec_mutex_destroy pthread_mutex_destroy |
pthread_mutex_init ((pthread_mutex_t *) (m), (a)) |
90 |
#define scm_i_plugin_rec_mutex_lock pthread_mutex_lock |
#define scm_i_plugin_rec_mutex_destroy(m) \ |
91 |
#define scm_i_plugin_rec_mutex_trylock pthread_mutex_trylock |
pthread_mutex_destroy ((pthread_mutex_t *) (m)) |
92 |
#define scm_i_plugin_rec_mutex_unlock pthread_mutex_unlock |
#define scm_i_plugin_rec_mutex_lock(m) \ |
93 |
|
pthread_mutex_lock ((pthread_mutex_t *) (m)) |
94 |
|
#define scm_i_plugin_rec_mutex_trylock(m) \ |
95 |
|
pthread_mutex_trylock ((pthread_mutex_t *) (m)) |
96 |
|
#define scm_i_plugin_rec_mutex_unlock(m) \ |
97 |
|
pthread_mutex_unlock ((pthread_mutex_t *) (m)) |
98 |
#else |
#else |
99 |
int scm_i_plugin_rec_mutex_init (scm_t_rec_mutex *, const scm_t_mutexattr *); |
int scm_i_plugin_rec_mutex_init (scm_t_rec_mutex *, const scm_t_mutexattr *); |
100 |
#define scm_i_plugin_rec_mutex_destroy(mx) do { (void) (mx); } while (0) |
#define scm_i_plugin_rec_mutex_destroy(mx) do { (void) (mx); } while (0) |
123 |
|
|
124 |
void scm_init_pthread_threads (void); |
void scm_init_pthread_threads (void); |
125 |
|
|
126 |
#endif /* SCM_THREADS_NULL_H */ |
#endif /* SCM_THREADS_PTHREADS_H */ |
127 |
|
|
128 |
/* |
/* |
129 |
Local Variables: |
Local Variables: |