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
32 #include "vm/global.h"
34 #if defined(ENABLE_THREADS)
35 # include "threads/posix/lock.h"
37 # include "threads/none/lock.h"
41 /* only define the following stuff with thread enabled ************************/
43 #if defined(ENABLE_THREADS)
45 /* functions ******************************************************************/
49 void lock_init_object_lock(java_object_t *);
51 ptrint lock_pre_compute_thinlock(s4 index);
53 bool lock_monitor_enter(java_handle_t *);
54 bool lock_monitor_exit(java_handle_t *);
56 #define LOCK_monitor_enter (functionptr) lock_monitor_enter
57 #define LOCK_monitor_exit (functionptr) lock_monitor_exit
59 bool lock_is_held_by_current_thread(java_handle_t *o);
61 void lock_wait_for_object(java_handle_t *o, s8 millis, s4 nanos);
62 void lock_notify_object(java_handle_t *o);
63 void lock_notify_all_object(java_handle_t *o);
65 #endif /* ENABLE_THREADS */
67 #endif /* _LOCK_COMMON_H */
71 * These are local overrides for various environment variables in Emacs.
72 * Please do not remove this and leave it at the end of the file, where
73 * Emacs will automagically detect them.
74 * ---------------------------------------------------------------------
81 * vim:noexpandtab:sw=4:ts=4: