[go: up one dir, main page]

File: thread.h

package info (click to toggle)
sablevm 1.11.3-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,980 kB
  • ctags: 7,922
  • sloc: ansic: 116,013; sh: 8,679; makefile: 489
file content (63 lines) | stat: -rw-r--r-- 1,825 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * This source file is part of SableVM.                            *
 *                                                                 *
 * See the file "LICENSE" for the copyright information and for    *
 * the terms and conditions for copying, distribution and          *
 * modification of this source file.                               *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef SVM_THREAD_H
#define SVM_THREAD_H

#define _svmm_mutex_init(mutex)			\
pthread_mutex_init (&mutex, NULL)

#define _svmm_mutex_destroy(mutex)		\
pthread_mutex_destroy (&mutex)

#define _svmm_mutex_lock(mutex)			\
{						\
  pthread_mutex_t *_svmx_pmutex = &mutex;	\
  pthread_mutex_lock (_svmx_pmutex)

#define _svmm_mutex_unlock()			\
  pthread_mutex_unlock (_svmx_pmutex);		\
}

#define _svmm_mutex_trylock(mutex)		\
pthread_mutex_trylock(&mutex)

#define _svmm_mutex_unlock_after_try(mutex)	\
pthread_mutex_unlock(&mutex)


#define _svmm_cond_init(cond) \
pthread_cond_init (&cond, NULL)

#define _svmm_cond_destroy(cond) \
pthread_cond_destroy (&cond)

#define _svmm_cond_wait(cond, mutex) \
pthread_cond_wait (&cond, &mutex)

#define _svmm_cond_timedwait(cond, mutex, abstime) \
pthread_cond_timedwait (&cond, &mutex, &abstime)

#define _svmm_cond_signal(cond) \
pthread_cond_signal (&cond)

#define _svmm_cond_broadcast(cond) \
pthread_cond_broadcast (&cond)

#define _svmm_cond_broadcast_ptr(cond) \
pthread_cond_broadcast (cond)

#define _svmm_kill(thread, signal) \
pthread_kill (thread, signal)

#define _svmm_enter_object_monitor_non_blocking(env, instance, succeeded) \
_svmh_enter_object_monitor_non_blocking (env, instance, &succeeded)

static _svmt_JNIEnv *_svmf_get_current_env (void);

#endif /* not SVM_THREAD_H */