-
Notifications
You must be signed in to change notification settings - Fork 392
/
thread_include.mk
274 lines (244 loc) · 8.29 KB
/
thread_include.mk
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
###############################################################################
# Copyright (c) 2015, 2021 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
# distribution and is available at https://www.eclipse.org/legal/epl-2.0/
# or the Apache License, Version 2.0 which accompanies this distribution and
# is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# This Source Code may also be made available under the following
# Secondary Licenses when the conditions for such availability set
# forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
# General Public License, version 2 with the GNU Classpath
# Exception [1] and GNU General Public License, version 2 with the
# OpenJDK Assembly Exception [2].
#
# [1] https://www.gnu.org/software/classpath/license.html
# [2] http://openjdk.java.net/legal/assembly-exception.html
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
###############################################################################
# This makefile fragment defines logic that is common to building both shared and static libraries.
# The user of this makefile must include omrmakefiles/configure.mk, to define the environment
# variables and the buildflags.
# The location of the thread source code is parameterized so that this makefile fragment can be used
# to build object files in a different directory.
THREAD_SRCDIR ?= ./
OBJECTS :=\
j9sem \
omrthread \
omrthreadattr \
omrthreaddebug \
omrthreaderror \
omrthreadinspect \
omrthreadmem \
omrthreadnuma \
omrthreadpriority \
omrthreadtls \
priority \
thrcreate \
threadhelpers \
thrprof \
thrdsup \
rasthrsup \
rwmutex \
ut_j9thr
ifeq (1,$(OMR_THR_JLM))
OBJECTS += omrthreadjlm
endif
ifneq (win,$(OMR_HOST_OS))
OBJECTS += unixpriority
else
OBJECTS += dllmain
vpath % $(THREAD_SRCDIR)win32
endif
MODULE_INCLUDES += $(THREAD_SRCDIR)
ifeq (zos,$(OMR_HOST_OS))
OBJECTS += thrcputime
vpath % $(THREAD_SRCDIR)zos390
vpath % $(THREAD_SRCDIR)unix
MODULE_INCLUDES += $(THREAD_SRCDIR)zos390 $(THREAD_SRCDIR)unix
endif
ifeq ($(OMR_HOST_OS),$(filter $(OMR_HOST_OS),linux linux_ztpf))
vpath % $(THREAD_SRCDIR)linux
vpath % $(THREAD_SRCDIR)unix
MODULE_INCLUDES += $(THREAD_SRCDIR)linux $(THREAD_SRCDIR)unix
endif
ifeq (osx,$(OMR_HOST_OS))
vpath % $(THREAD_SRCDIR)osx
vpath % $(THREAD_SRCDIR)unix
MODULE_INCLUDES += $(THREAD_SRCDIR)osx $(THREAD_SRCDIR)unix
endif
ifeq (aix,$(OMR_HOST_OS))
vpath % $(THREAD_SRCDIR)aix
vpath % $(THREAD_SRCDIR)unix
MODULE_INCLUDES += $(THREAD_SRCDIR)aix $(THREAD_SRCDIR)unix
endif
vpath % $(THREAD_SRCDIR)common
MODULE_INCLUDES += $(THREAD_SRCDIR)common
vpath %.c $(THREAD_SRCDIR)
vpath %.cpp $(THREAD_SRCDIR)
# Disable some warnings
ifeq ($(OMR_TOOLCHAIN),gcc)
MODULE_CFLAGS += -Wno-unused
endif
OBJECTS := $(addsuffix $(OBJEXT),$(OBJECTS))
ifeq (zos,$(OMR_HOST_OS))
define WRITE_ZOS_THREAD_EXPORTS
@echo omrthread_get_os_errno2 >>$@
endef
endif
ifeq (1,$(OMR_THR_JLM))
define WRITE_JLM_THREAD_EXPORTS
@echo omrthread_jlm_init >>$@
@echo omrthread_jlm_get_gc_lock_tracing >>$@
endef
endif
ifeq (1,$(OMR_THR_ADAPTIVE_SPIN))
define WRITE_ADAPTIVE_SPIN_THREAD_EXPORTS
@echo jlm_adaptive_spin_init >>$@
endef
endif
define WRITE_COMMON_THREAD_EXPORTS
@echo j9sem_init >>$@
@echo j9sem_post >>$@
@echo j9sem_wait >>$@
@echo j9sem_destroy >>$@
@echo omrthread_init_library >>$@
@echo omrthread_shutdown_library >>$@
@echo omrthread_get_os_errno >>$@
@echo omrthread_get_errordesc >>$@
@echo omrthread_current_stack_free >>$@
@echo omrthread_abort >>$@
@echo omrthread_attach >>$@
@echo omrthread_attach_ex >>$@
@echo omrthread_waiting_to_acquire >>$@
@echo omrthread_monitor_is_acquired >>$@
@echo omrthread_monitor_get_acquired_count >>$@
@echo omrthread_monitor_get_current_owner >>$@
@echo omrthread_create >>$@
@echo omrthread_create_ex >>$@
@echo omrthread_cancel >>$@
@echo omrthread_join >>$@
@echo omrthread_interrupt >>$@
@echo omrthread_clear_interrupted >>$@
@echo omrthread_interrupted >>$@
@echo omrthread_priority_interrupt >>$@
@echo omrthread_clear_priority_interrupted >>$@
@echo omrthread_priority_interrupted >>$@
@echo omrthread_monitor_destroy >>$@
@echo omrthread_monitor_destroy_nolock >>$@
@echo omrthread_monitor_flush_destroyed_monitor_list >>$@
@echo omrthread_monitor_enter >>$@
@echo omrthread_monitor_get_name >>$@
@echo omrthread_monitor_enter_abortable_using_threadId >>$@
@echo omrthread_monitor_enter_using_threadId >>$@
@echo omrthread_monitor_try_enter >>$@
@echo omrthread_monitor_try_enter_using_threadId >>$@
@echo omrthread_monitor_exit >>$@
@echo omrthread_monitor_exit_using_threadId >>$@
@echo omrthread_monitor_owned_by_self >>$@
@echo omrthread_monitor_init_with_name >>$@
@echo omrthread_monitor_notify >>$@
@echo omrthread_monitor_notify_all >>$@
@echo omrthread_monitor_wait >>$@
@echo omrthread_monitor_wait_timed >>$@
@echo omrthread_monitor_wait_abortable >>$@
@echo omrthread_monitor_wait_interruptable >>$@
@echo omrthread_monitor_num_waiting >>$@
@echo omrthread_resume >>$@
@echo omrthread_self >>$@
@echo omrthread_set_priority >>$@
@echo omrthread_get_priority >>$@
@echo omrthread_sleep >>$@
@echo omrthread_sleep_interruptable >>$@
@echo omrthread_suspend >>$@
@echo omrthread_tls_alloc >>$@
@echo omrthread_tls_alloc_with_finalizer >>$@
@echo omrthread_tls_free >>$@
@echo omrthread_tls_get >>$@
@echo omrthread_tls_set >>$@
@echo omrthread_yield >>$@
@echo omrthread_yield_new >>$@
@echo omrthread_exit >>$@
@echo omrthread_detach >>$@
@echo omrthread_global >>$@
@echo omrthread_global_monitor >>$@
@echo omrthread_get_flags >>$@
@echo omrthread_get_state >>$@
@echo omrthread_get_osId >>$@
@echo omrthread_get_ras_tid >>$@
@echo omrthread_get_stack_range >>$@
@echo omrthread_monitor_init_walk >>$@
@echo omrthread_monitor_walk >>$@
@echo omrthread_monitor_walk_no_locking >>$@
@echo omrthread_rwmutex_init >>$@
@echo omrthread_rwmutex_destroy >>$@
@echo omrthread_rwmutex_enter_read >>$@
@echo omrthread_rwmutex_exit_read >>$@
@echo omrthread_rwmutex_enter_write >>$@
@echo omrthread_rwmutex_try_enter_write >>$@
@echo omrthread_rwmutex_exit_write >>$@
@echo omrthread_rwmutex_is_writelocked >>$@
@echo omrthread_park >>$@
@echo omrthread_unpark >>$@
@echo omrthread_numa_get_max_node >>$@
@echo omrthread_numa_set_enabled >>$@
@echo omrthread_numa_set_node_affinity >>$@
@echo omrthread_numa_get_node_affinity >>$@
@echo omrthread_map_native_priority >>$@
@echo omrthread_set_priority_spread >>$@
@echo omrthread_set_name >>$@
@echo omrthread_lib_enable_cpu_monitor >>$@
@echo omrthread_lib_lock >>$@
@echo omrthread_lib_try_lock >>$@
@echo omrthread_lib_unlock >>$@
@echo omrthread_lib_get_flags >>$@
@echo omrthread_lib_set_flags >>$@
@echo omrthread_lib_clear_flags >>$@
@echo omrthread_lib_control >>$@
@echo omrthread_lib_use_realtime_scheduling >>$@
@echo omrthread_attr_init >>$@
@echo omrthread_attr_destroy >>$@
@echo omrthread_attr_set_name >>$@
@echo omrthread_attr_set_schedpolicy >>$@
@echo omrthread_attr_set_priority >>$@
@echo omrthread_attr_set_stacksize >>$@
@echo omrthread_attr_set_category >>$@
@echo omrthread_attr_set_detachstate>>$@
@# for builder use only
@echo omrthread_monitor_lock >>$@
@echo omrthread_monitor_unlock >>$@
@echo omrthread_monitor_pin >>$@
@echo omrthread_monitor_unpin >>$@
@echo omrthread_nanosleep >>$@
@echo omrthread_nanosleep_supported >>$@
@echo omrthread_nanosleep_to >>$@
@echo omrthread_get_user_time >>$@
@echo omrthread_get_self_user_time >>$@
@echo omrthread_get_cpu_time >>$@
@echo omrthread_get_cpu_time_ex >>$@
@echo omrthread_get_self_cpu_time >>$@
@echo omrthread_get_process_times >>$@
@echo omrthread_get_handle >>$@
@echo omrthread_get_stack_size >>$@
@echo omrthread_get_os_priority >>$@
@echo omrthread_get_stack_usage >>$@
@echo omrthread_enable_stack_usage >>$@
@# process-wide statistics
@echo omrthread_get_process_cpu_time >>$@
@echo omrthread_get_jvm_cpu_usage_info >>$@
@echo omrthread_get_jvm_cpu_usage_info_error_recovery >>$@
@echo omrthread_get_category >>$@
@echo omrthread_set_category >>$@
@# temp for the JIT
@echo j9thread_self >>$@
@echo j9thread_tls_get >>$@
endef
define WRITE_THREAD_EXPORTS
$(WRITE_COMMON_THREAD_EXPORTS)
$(WRITE_ZOS_THREAD_EXPORTS)
$(WRITE_JLM_THREAD_EXPORTS)
$(WRITE_ADAPTIVE_SPIN_THREAD_EXPORTS)
endef