19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_RUNTIME_THREADIDENTIFIER_HPP
26 #define SHARE_RUNTIME_THREADIDENTIFIER_HPP
27
28 #include "memory/allStatic.hpp"
29
30 /*
31 * Provides unique monotonic identifiers for threads.
32 *
33 * Java uses unsafe to initialize the tid field for Thread and VirtualThread on construction.
34 * JFR uses next() for a non-reusable id for non-java threads.
35 */
36 class ThreadIdentifier : AllStatic {
37 public:
38 static int64_t next();
39 static int64_t unsafe_offset();
40 };
41
42 #endif // SHARE_RUNTIME_THREADIDENTIFIER_HPP
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_RUNTIME_THREADIDENTIFIER_HPP
26 #define SHARE_RUNTIME_THREADIDENTIFIER_HPP
27
28 #include "memory/allStatic.hpp"
29
30 /*
31 * Provides unique monotonic identifiers for threads.
32 *
33 * Java uses unsafe to initialize the tid field for Thread and VirtualThread on construction.
34 * JFR uses next() for a non-reusable id for non-java threads.
35 */
36 class ThreadIdentifier : AllStatic {
37 public:
38 static int64_t next();
39 static int64_t current();
40 static int64_t unsafe_offset();
41 DEBUG_ONLY(static int64_t initial();)
42 };
43
44 #endif // SHARE_RUNTIME_THREADIDENTIFIER_HPP
|