1 /* src/threads/lock-common.h - common stuff of lock implementation
3 Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28 #ifndef _LOCK_COMMON_H
29 #define _LOCK_COMMON_H
34 #include "vm/global.h"
36 #if defined(ENABLE_THREADS)
37 # include "threads/native/lock.h"
39 # include "threads/none/lock.h"
43 /* only define the following stuff with thread enabled ************************/
45 #if defined(ENABLE_THREADS)
47 /* functions ******************************************************************/
51 void lock_init_object_lock(java_object_t *);
53 ptrint lock_pre_compute_thinlock(s4 index);
55 bool lock_monitor_enter(java_handle_t *);
56 bool lock_monitor_exit(java_handle_t *);
58 #define LOCK_monitor_enter (functionptr) lock_monitor_enter
59 #define LOCK_monitor_exit (functionptr) lock_monitor_exit
61 bool lock_is_held_by_current_thread(java_handle_t *o);
63 void lock_wait_for_object(java_handle_t *o, s8 millis, s4 nanos);
64 void lock_notify_object(java_handle_t *o);
65 void lock_notify_all_object(java_handle_t *o);
67 #endif /* ENABLE_THREADS */
69 #endif /* _LOCK_COMMON_H */
73 * These are local overrides for various environment variables in Emacs.
74 * Please do not remove this and leave it at the end of the file, where
75 * Emacs will automagically detect them.
76 * ---------------------------------------------------------------------
83 * vim:noexpandtab:sw=4:ts=4: