forked from eclipse-openj9/openj9-omr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththread_api.h
1477 lines (1241 loc) · 27.5 KB
/
thread_api.h
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*******************************************************************************
* Copyright (c) 1991, 2020 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
*******************************************************************************/
#ifndef thread_api_h
#define thread_api_h
/*
* @ddr_namespace: map_to_type=ThreadApiConstants
*/
/**
* @file thread_api.h
* @brief Public API for the THREAD module.
*
* This file contains public function prototypes and
* type definitions for the THREAD module.
*
*/
#include "omrcfg.h"
#include "omrthread.h"
#include "omrcomp.h"
#ifdef __cplusplus
extern "C" {
#endif
#define J9THREAD_RWMUTEX_OK 0
#define J9THREAD_RWMUTEX_FAIL 1
#define J9THREAD_RWMUTEX_WOULDBLOCK -1
/* Define conversions for units of time used in thrprof.c */
#define SEC_TO_NANO_CONVERSION_CONSTANT (1000 * 1000 * 1000)
#define MICRO_TO_NANO_CONVERSION_CONSTANT 1000
#define GET_PROCESS_TIMES_IN_NANO 100
typedef struct omrthread_process_time_t {
/* For consistency sake, times are stored as int64_t's */
int64_t _systemTime;
int64_t _userTime;
} omrthread_process_time_t;
typedef struct omrthread_state_t {
uintptr_t flags;
omrthread_monitor_t blocker;
omrthread_t owner;
uintptr_t count;
} omrthread_state_t;
typedef struct omrthread_attr *omrthread_attr_t;
#define J9THREAD_ATTR_DEFAULT ((omrthread_attr_t *)NULL)
typedef enum omrthread_detachstate_t {
J9THREAD_CREATE_DETACHED,
J9THREAD_CREATE_JOINABLE,
/* ensure 4-byte enum */
omrthread_detachstate_EnsureWideEnum = 0x1000000
} omrthread_detachstate_t;
typedef enum omrthread_schedpolicy_t {
J9THREAD_SCHEDPOLICY_INHERIT,
J9THREAD_SCHEDPOLICY_OTHER,
J9THREAD_SCHEDPOLICY_RR,
J9THREAD_SCHEDPOLICY_FIFO,
/* dummy value marking end of list */
omrthread_schedpolicy_LastEnum,
/* ensure 4-byte enum */
omrthread_schedpolicy_EnsureWideEnum = 0x1000000
} omrthread_schedpolicy_t;
typedef uintptr_t omrthread_prio_t;
typedef struct omrthread_monitor_walk_state_t {
struct J9ThreadMonitorPool *pool;
uintptr_t monitorIndex;
BOOLEAN lockTaken;
} omrthread_monitor_walk_state_t;
/* ---------------- omrthreadinspect.c ---------------- */
/**
* @brief
* @param void
* @return void
*/
intptr_t
omrthread_init_library(void);
/**
* @brief
* @param void
* @return void
*/
void
omrthread_shutdown_library(void);
/**
* @brief
* @param thread
* @param blocker
* @return uintptr_t
*/
uintptr_t
omrthread_get_flags(omrthread_t thread, omrthread_monitor_t *blocker);
/**
* @brief
* @param thread
* @param state
* @return void
*/
void
omrthread_get_state(omrthread_t thread, omrthread_state_t *const state);
/**
* @brief
* @param thread
* @return uintptr_t
*/
uintptr_t
omrthread_get_priority(omrthread_t thread);
/**
* @brief
* @param thread
* @return uintptr_t
*/
uintptr_t
omrthread_get_osId(omrthread_t thread);
/**
* @brief
* @param monitor
* @return char*
*/
char *
omrthread_monitor_get_name(omrthread_monitor_t monitor);
/**
* @brief
* @param thread
* @param stackStart
* @param stackEnd
* @return uintptr_t
*/
uintptr_t
omrthread_get_stack_range(omrthread_t thread, void **stackStart, void **stackEnd);
#if (defined(OMR_THR_JLM))
/**
* @brief
* @param monitor
* @return J9ThreadMonitorTracing*
*/
J9ThreadMonitorTracing *
omrthread_monitor_get_tracing(omrthread_monitor_t monitor);
#endif /* OMR_THR_JLM */
/**
* @brief
* @param walkState
* @return omrthread_monitor_t
*/
omrthread_monitor_t
omrthread_monitor_walk(omrthread_monitor_walk_state_t *walkState);
/**
* @brief
* @param walkState
* @return omrthread_monitor_t
*/
omrthread_monitor_t
omrthread_monitor_walk_no_locking(omrthread_monitor_walk_state_t *walkState);
/**
* @brief
* @param walkState
* @return void
*/
void
omrthread_monitor_init_walk(omrthread_monitor_walk_state_t *walkState);
/**
* @brief
* @param thread
* @param key
* @return void*
*/
void *
omrthread_tls_get(omrthread_t thread, omrthread_tls_key_t key);
/**
* @brief
* @param monitor
* @return uintptr_t
*/
uintptr_t
omrthread_monitor_owned_by_self(omrthread_monitor_t monitor);
/**
* Turn on CPU monitoring and enable monitoring on the current thread.
* This function is called early in startup.
* (CPU Monitoring is turned off by default in OMR)
* @param thread
* @return void
*/
void
omrthread_lib_enable_cpu_monitor(omrthread_t thread);
/* ---------------- rwmutex.c ---------------- */
/**
* @struct
*/
struct RWMutex;
/**
*@typedef
*/
typedef struct RWMutex *omrthread_rwmutex_t;
/**
* @brief
* @param mutex
* @return intptr_t
*/
intptr_t
omrthread_rwmutex_destroy(omrthread_rwmutex_t mutex);
/**
* @brief
* @param mutex
* @return intptr_t
*/
intptr_t
omrthread_rwmutex_enter_read(omrthread_rwmutex_t mutex);
/**
* @brief
* @param mutex
* @return intptr_t
*/
intptr_t
omrthread_rwmutex_enter_write(omrthread_rwmutex_t mutex);
/**
* @brief
* @param mutex
* @returns intptr_t
*/
intptr_t
omrthread_rwmutex_try_enter_write(omrthread_rwmutex_t mutex);
/**
* @brief
* @param mutex
* @return intptr_t
*/
intptr_t
omrthread_rwmutex_exit_read(omrthread_rwmutex_t mutex);
/**
* @brief
* @param mutex
* @return intptr_t
*/
intptr_t
omrthread_rwmutex_exit_write(omrthread_rwmutex_t mutex);
/**
* @brief
* @param handle
* @param flags
* @param name
* @return intptr_t
*/
intptr_t
omrthread_rwmutex_init(omrthread_rwmutex_t *handle, uintptr_t flags, const char *name);
/**
* @brief
* @param mutex
* @return BOOLEAN
*/
BOOLEAN
omrthread_rwmutex_is_writelocked(omrthread_rwmutex_t mutex);
/* ---------------- omrthreadpriority.c ---------------- */
/**
* @brief
* @param nativePriority
* @return uintptr_t
*/
uintptr_t
omrthread_map_native_priority(int nativePriority);
/* ---------------- omrthread.c ---------------- */
/**
* @brief
* @param s
* @return intptr_t
*/
intptr_t
j9sem_destroy(j9sem_t s);
/**
* @brief
* @param sp
* @param initValue
* @return intptr_t
*/
intptr_t
j9sem_init(j9sem_t *sp, int32_t initValue);
/**
* @brief
* @param s
* @return intptr_t
*/
intptr_t
j9sem_post(j9sem_t s);
/**
* @brief
* @param s
* @return intptr_t
*/
intptr_t
j9sem_wait(j9sem_t s);
/**
* @brief
* @param handle
* @return void
*/
void
omrthread_abort(omrthread_t handle);
/**
* @brief
* @param handle
* @return intptr_t
*/
intptr_t
omrthread_attach(omrthread_t *handle);
/**
* Wait for a thread to terminate
*
* This function follows the conventions of pthread_join().
*
* - A thread can't join itself.
* - A thread can only be joined once.
* - The target thread must have been created with detachstate=J9THREAD_CREATE_JOINABLE.
*
* If you pass in an invalid thread argument, the behaviour is undefined
* because the omrthread_t is in an unknown state. The function may segv.
*
* A joinable thread MUST be joined to free its resources.
*
* @param[in] thread Wait for this given thread to terminate.
* @return a omrthread error code
* @retval J9THREAD_SUCCESS Success
* @retval J9THREAD_INVALID_ARGUMENT Target thread is the current thread,
* or the target thread could be determined to be non-joinable.
* @retval J9THREAD_TIMED_OUT The O/S join function returned a timeout status.
* @retval J9THREAD_ERR The O/S join function returned an error code.
* @retval J9THREAD_ERR|J9THREAD_ERR_OS_ERRNO_SET The O/S join function returned an error code,
* and an os_errno is also available.
*/
intptr_t
omrthread_join(omrthread_t thread);
/**
* @brief
* @param thread
* @return void
*/
void
omrthread_cancel(omrthread_t thread);
/**
* Helper function that attaches an existing OS thread
* to the threading library based on the attributes passed.
*
* Create a new omrthread_t to represent the existing OS thread.
* Attaching a thread is required when a thread was created
* outside of the J9 threading library wants to use any of the
* J9 threading library functionality.
*
* If the OS thread is already attached, handle is set to point
* to the existing omrthread_t.
*
* If a NULL attr is passed, the thread will be classified as a J9THREAD_CATEGORY_SYSTEM_THREAD thread.
* If a non NULL attr is passed, only the thread category will be used, all other attributes will be ignored.
*
* @param[out] handle pointer to a omrthread_t to be set (will be ignored if null)
* @param[in] attr of the thread to be set
* @return success or error code
* @retval J9THREAD_SUCCESS success
* @retval J9THREAD_ERR_xxx failure
*
* @see omrthread_attach
* @see omrthread_detach
*/
intptr_t
omrthread_attach_ex(omrthread_t *handle, omrthread_attr_t *attr);
/**
* @brief
* @param void
* @return uintptr_t
*/
uintptr_t
omrthread_clear_interrupted(void);
/**
* @brief
* @param void
* @return uintptr_t
*/
uintptr_t
omrthread_clear_priority_interrupted(void);
/**
* @brief
* @param handle
* @param stacksize
* @param priority
* @param suspend
* @param entrypoint
* @param entryarg
* @return intptr_t
*/
intptr_t
omrthread_create(omrthread_t *handle, uintptr_t stacksize, uintptr_t priority, uintptr_t suspend, omrthread_entrypoint_t entrypoint, void *entryarg);
/**
* @brief
* @param handle
* @param attr
* @param suspend
* @param entrypoint
* @param entryarg
* @return intptr_t
*/
intptr_t
omrthread_create_ex(omrthread_t *handle, const omrthread_attr_t *attr, uintptr_t suspend, omrthread_entrypoint_t entrypoint, void *entryarg);
/**
* @brief
* @param void
* @return uintptr_t
*/
uintptr_t
omrthread_current_stack_free(void);
/**
* @brief
* @param thread
* @return void
*/
void
omrthread_detach(omrthread_t thread);
#if (defined(OMR_THR_TRACING))
/**
* @brief
* @param thread
* @return void
*/
void
omrthread_dump_trace(omrthread_t thread);
#endif /* OMR_THR_TRACING */
/**
* @brief
* @param monitor
* @return void
*/
void OMRNORETURN
omrthread_exit(omrthread_monitor_t monitor);
/**
* @brief
* @param name
* @return uintptr_t*
*/
uintptr_t *
omrthread_global(char *name);
/**
* @brief
* @return omrthread_monitor_t
*/
omrthread_monitor_t
omrthread_global_monitor(void);
/**
* Return monitor that thread is currently waiting to acquire.
* If thread is not waiting on a monitor return null.
* @param thread
* @return omrthread_monitor_t
*/
omrthread_monitor_t
omrthread_waiting_to_acquire(omrthread_t thread);
/**
* Return true if monitor is currently acquired.
* @param monitor
* @return BOOLEAN
*/
BOOLEAN
omrthread_monitor_is_acquired(omrthread_monitor_t monitor);
/**
* Monitor may be acquired multiple times by the current owner.
* Return number of times it has been acquired. Zero means
* the monitor is not acquired.
* @param monitor
* @return intptr_t
*/
intptr_t
omrthread_monitor_get_acquired_count(omrthread_monitor_t monitor);
/**
* Return thread that currently owns the monitor. Null
* will be returned if monitor is not owned.
* @param monitor
* @return omrthread_t
*/
omrthread_t
omrthread_monitor_get_current_owner(omrthread_monitor_t monitor);
/**
* @brief
* @param thread
* @return void
*/
void
omrthread_interrupt(omrthread_t thread);
/**
* @brief
* @param thread
* @return uintptr_t
*/
uintptr_t
omrthread_interrupted(omrthread_t thread);
#if (defined(OMR_THR_JLM))
/**
* @brief
* @param void
* @return J9ThreadMonitorTracing*
*/
J9ThreadMonitorTracing *
omrthread_jlm_get_gc_lock_tracing(void);
#endif /* OMR_THR_JLM */
#if (defined(OMR_THR_JLM))
/**
* @brief
* @param flags
* @return intptr_t
*/
intptr_t
omrthread_jlm_init(uintptr_t flags);
#endif /* OMR_THR_JLM */
#if defined(OMR_THR_ADAPTIVE_SPIN)
/**
* @brief initializes jlm for capturing data needed by the adaptive spin options
* @param thread
* @param adaptiveFlags flags indicating the adaptive modes that have been enabled
* @return intptr_t
*/
intptr_t
jlm_adaptive_spin_init(void);
#endif
/**
* @brief
* @param void
* @return uintptr_t
*/
uintptr_t
omrthread_lib_get_flags(void);
/**
* @brief
* @param flags
* @return uintptr_t
*/
uintptr_t
omrthread_lib_set_flags(uintptr_t flags);
/**
* @brief
* @param flags
* @return uintptr_t
*/
uintptr_t
omrthread_lib_clear_flags(uintptr_t flags);
#define J9THREAD_LIB_CONTROL_TRACE_START "trace_start"
#define J9THREAD_LIB_CONTROL_TRACE_STOP "trace_stop"
#define J9THREAD_LIB_CONTROL_GET_MEM_CATEGORIES "get_mem_categories"
#if defined(LINUX) || defined(OSX)
#define J9THREAD_LIB_CONTROL_USE_REALTIME_SCHEDULING "use_realtime_scheduling"
#define J9THREAD_LIB_CONTROL_USE_REALTIME_SCHEDULING_ENABLED ((uintptr_t) J9THREAD_LIB_FLAG_REALTIME_SCHEDULING_ENABLED)
#define J9THREAD_LIB_CONTROL_USE_REALTIME_SCHEDULING_DISABLED ((uintptr_t) 0)
#endif /* defined(LINUX) || defined(OSX) */
/**
* @brief Control the thread library.
* @param key
* @param value
* @return intptr_t 0 on success, -1 on failure.
*/
intptr_t
omrthread_lib_control(const char *key, uintptr_t value);
/**
* @brief
* @param self
* @return void
*/
void
omrthread_lib_lock(omrthread_t self);
/**
* @brief
* @param self
* @return intptr_t
*/
intptr_t
omrthread_lib_try_lock(omrthread_t self);
/**
* @brief
* @param self
* @return void
*/
void
omrthread_lib_unlock(omrthread_t self);
#if defined(OMR_THR_FORK_SUPPORT)
/**
* Post-fork reset function used to clean up and reset old omrthread and omrthread_monitor structures
* associated with non-existent threads in the child process. This function is to be called directly
* before fork and requires an attached thread.
*
* Since WIN32 has no fork, this code is currently not included. For WIN32, some of the reset code
* is incomplete: in postForkResetThreads, the omrthread_t->handle must be reset differently.
*
* @note This function must only be called in the child process immediately following a fork().
*/
void
omrthread_lib_postForkChild(void);
/**
* Perform post-fork unlocking of mutexes that must be held over a fork and reset. This function is
* to be called directly after a fork, before any other omrthread functions, and requires an attached
* thread.
*/
void
omrthread_lib_postForkParent(void);
/**
* Perform pre-fork locking of mutexes that must be held over a fork and reset. This function is
* to be called directly after a fork, before any other omrthread functions, and requires an attached
* thread.
*/
void
omrthread_lib_preFork(void);
#endif /* !defined(OMR_THR_FORK_SUPPORT) */
/**
* @brief
* @param monitor
* @return intptr_t
*/
intptr_t
omrthread_monitor_destroy(omrthread_monitor_t monitor);
/**
* @brief
* @param monitor
* @return intptr_t
*/
intptr_t
omrthread_monitor_destroy_nolock(omrthread_t self, omrthread_monitor_t monitor);
/**
* @brief
* @param void
* @return void
*/
void
omrthread_monitor_flush_destroyed_monitor_list(omrthread_t self);
#if (defined(OMR_THR_TRACING))
/**
* @brief
* @param void
* @return void
*/
void
omrthread_monitor_dump_all(void);
#endif /* OMR_THR_TRACING */
#if (defined(OMR_THR_TRACING))
/**
* @brief
* @param monitor
* @return void
*/
void
omrthread_monitor_dump_trace(omrthread_monitor_t monitor);
#endif /* OMR_THR_TRACING */
/**
* @brief
* @param monitor
* @return intptr_t
*/
intptr_t
omrthread_monitor_enter(omrthread_monitor_t monitor);
/**
* @brief
* @param monitor
* @param threadId
* @return intptr_t
*/
intptr_t
omrthread_monitor_enter_abortable_using_threadId(omrthread_monitor_t monitor, omrthread_t threadId);
/**
* @brief
* @param monitor
* @param threadId
* @return intptr_t
*/
intptr_t
omrthread_monitor_enter_using_threadId(omrthread_monitor_t monitor, omrthread_t threadId);
/**
* @brief
* @param monitor
* @return intptr_t
*/
intptr_t
omrthread_monitor_exit(omrthread_monitor_t monitor);
/**
* @brief
* @param monitor
* @param threadId
* @return intptr_t
*/
intptr_t
omrthread_monitor_exit_using_threadId(omrthread_monitor_t monitor, omrthread_t threadId);
/**
* @brief
* @param handle
* @param flags
* @param name
* @return intptr_t
*/
intptr_t
omrthread_monitor_init_with_name(omrthread_monitor_t *handle, uintptr_t flags, const char *name);
/**
* @brief
* @param self
* @param monitor
* @return void
*/
void
omrthread_monitor_lock(omrthread_t self, omrthread_monitor_t monitor);
/**
* @brief
* @param monitor
* @return intptr_t
*/
intptr_t
omrthread_monitor_notify(omrthread_monitor_t monitor);
/**
* @brief
* @param monitor
* @return intptr_t
*/
intptr_t
omrthread_monitor_notify_all(omrthread_monitor_t monitor);
/**
* @brief
* @param monitor
* @return uintptr_t
*/
uintptr_t
omrthread_monitor_num_waiting(omrthread_monitor_t monitor);
/**
* @brief
* @param monitor
* @return intptr_t
*/
intptr_t
omrthread_monitor_try_enter(omrthread_monitor_t monitor);
/**
* @brief
* @param monitor
* @param threadId
* @return intptr_t
*/
intptr_t
omrthread_monitor_try_enter_using_threadId(omrthread_monitor_t monitor, omrthread_t threadId);
/**
* @brief
* @param self
* @param monitor
* @return void
*/
void
omrthread_monitor_unlock(omrthread_t self, omrthread_monitor_t monitor);
/**
* @brief
* @param monitor
* @return intptr_t
*/
intptr_t
omrthread_monitor_wait(omrthread_monitor_t monitor);
/**
* @brief
* @param monitor
* @param millis
* @param nanos
* @return intptr_t
*/
intptr_t
omrthread_monitor_wait_abortable(omrthread_monitor_t monitor, int64_t millis, intptr_t nanos);
/**
* @brief
* @param monitor
* @param millis
* @param nanos
* @return intptr_t
*/
intptr_t
omrthread_monitor_wait_interruptable(omrthread_monitor_t monitor, int64_t millis, intptr_t nanos);
/**
* @brief
* @param monitor
* @param millis
* @param nanos
* @return intptr_t
*/
intptr_t
omrthread_monitor_wait_timed(omrthread_monitor_t monitor, int64_t millis, intptr_t nanos);
/**
* @brief
* @param nanos
* @return intptr_t
*/
intptr_t
omrthread_nanosleep(int64_t nanos);
/**
* @brief
* @param void
* @return intptr_t
*/
intptr_t
omrthread_nanosleep_supported(void);
/**
* @brief
* @param wakeTime
* @return intptr_t
*/
intptr_t
omrthread_nanosleep_to(int64_t wakeTime);
/**
* @brief
* @param millis
* @param nanos
* @return intptr_t
*/
intptr_t
omrthread_park(int64_t millis, intptr_t nanos);
/**
* @brief
* @param thread
* @return void
*/
void
omrthread_priority_interrupt(omrthread_t thread);
/**
* @brief
* @param thread
* @return uintptr_t
*/
uintptr_t
omrthread_priority_interrupted(omrthread_t thread);
#if (defined(OMR_THR_TRACING))
/**
* @brief
* @param void
* @return void
*/
void
omrthread_reset_tracing(void);
#endif /* OMR_THR_TRACING */
/**
* @brief
* @param thread