1 /* src/threads/lock-common.h - common stuff of lock implementation
3 Copyright (C) 2007, 2008
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 #ifndef _LOCK_COMMON_H
27 #define _LOCK_COMMON_H
37 #include "vm/global.h"
39 #if defined(ENABLE_THREADS)
40 # include "threads/posix/lock.h"
42 # include "threads/none/lock.h"
46 /* only define the following stuff with thread enabled ************************/
48 #if defined(ENABLE_THREADS)
50 /* functions ******************************************************************/
54 void lock_init_object_lock(java_object_t *);
56 ptrint lock_pre_compute_thinlock(s4 index);
58 bool lock_monitor_enter(java_handle_t *);
59 bool lock_monitor_exit(java_handle_t *);
61 #define LOCK_monitor_enter (functionptr) lock_monitor_enter
62 #define LOCK_monitor_exit (functionptr) lock_monitor_exit
64 bool lock_is_held_by_current_thread(java_handle_t *o);
66 void lock_wait_for_object(java_handle_t *o, s8 millis, s4 nanos);
67 void lock_notify_object(java_handle_t *o);
68 void lock_notify_all_object(java_handle_t *o);
70 #endif /* ENABLE_THREADS */
76 #endif /* _LOCK_COMMON_H */
80 * These are local overrides for various environment variables in Emacs.
81 * Please do not remove this and leave it at the end of the file, where
82 * Emacs will automagically detect them.
83 * ---------------------------------------------------------------------
90 * vim:noexpandtab:sw=4:ts=4: