19#ifndef _RVM_PTHREAD_H_
20#define _RVM_PTHREAD_H_
33#define BOGUSCODE (BOGUS_USE_OF_PTHREADS)
35#define RVM_MUTEX pthread_mutex_t
36#define RVM_CONDITION pthread_cond_t
56#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
60#define cthread_t pthread_t *
62#define cthread_fork(fname, arg) \
63 (pthread_create(&rvm_pthreadid, NULL, (void *(*)(void *))(fname), (arg)), \
72#define cthread_join(t) \
73 (rvm_join_res = pthread_join(*(t), &rvm_ptstat), \
74 (rvm_join_res) ? NULL : rvm_ptstat)
76#define cthread_init() \
80#define cthread_uninit(retval) \
84#define cthread_exit(retval) (pthread_exit((void *)(retval)))
86#define cthread_yield() \
90#define condition_wait(c, m) (pthread_cond_wait((c), (m)))
92#define condition_signal(c) (pthread_cond_signal((c)))
94#define condition_broadcast(c) (pthread_cond_broadcast((c)))
97#define condition_clear(c)
99#define condition_init(c) (pthread_cond_init((c), NULL))
101#define mutex_init(m) (pthread_mutex_init((m), NULL))
102#define mutex_clear(m) (pthread_mutex_destroy(m), NULL)
112#define LOCK_FREE(m) (rvm_lock_free(&(m)))
114#define cthread_self() (rvm_pthreadid = pthread_self(), &rvm_pthreadid)
117#define mutex_lock(m) \
119 printf("mutex_lock OL(0x%x)%s:%d...", (m), __FILE__, __LINE__); \
120 pthread_mutex_lock((m)); \
123#define mutex_unlock(m) \
125 printf("mutex_unlock RL(0x%x)%s:%d...", (m), __FILE__, __LINE__); \
126 pthread_mutex_unlock((m)); \
130#define mutex_lock(m) (pthread_mutex_lock((m)))
131#define mutex_unlock(m) (pthread_mutex_unlock((m)))
136#define mutex_alloc() BOGUSCODE
137#define mutex_set_name(m, x) BOGUSCODE
138#define mutex_name(m) BOGUSCODE
139#define mutex_free(m) BOGUSCODE
141#define condition_alloc() BOGUSCODE
142#define condition_set_name(c, x) BOGUSCODE
143#define condition_name(c) BOGUSCODE
144#define condition_free(c) BOGUSCODE
146#define cthread_detach() BOGUSCODE
147#define cthread_sp() BOGUSCODE
148#define cthread_assoc(id, t) BOGUSCODE
149#define cthread_set_name BOGUSCODE
150#define cthread_name BOGUSCODE
151#define cthread_count() BOGUSCODE
152#define cthread_set_limit BOGUSCODE
153#define cthread_limit() BOGUSCODE
154#define cthread_set_data(t, x) BOGUSCODE
155#define cthread_data(t) BOGUSCODE
int rvm_lock_free(pthread_mutex_t *m)
Definition: rvm_pthread.c:26
void * rvm_ptstat
Definition: rvm_pthread.c:23
pthread_t rvm_pthreadid
Definition: rvm_pthread.c:22
int rvm_join_res
Definition: rvm_pthread.c:24