9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-20 23:49:31 +00:00
Files
Leaf/leaf-server/paper-patches/features/0025-Virtual-thread-support.patch
2025-07-12 16:03:27 +08:00

33 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Wed, 9 Aug 2023 15:04:56 +0200
Subject: [PATCH] Virtual thread support
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index c0255b4493cfcdd4b89f4002b731adaf57422f61..4e7adf20887c527d2a011040d9d616f6065c5726 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -970,6 +970,19 @@ public class Metrics {
}));
// Gale end - SIMD support - include in metrics
+ // Gale start - virtual thread support - include in metrics
+ Map<String, Map<String, Integer>> virtualThreadSupportMap = new HashMap<>(2);
+ {
+ Map<String, Integer> entry = new HashMap<>(2);
+ boolean isSupported = org.galemc.gale.virtualthread.VirtualThreadService.isSupported();
+ int javaMajorVersion = Runtime.version().feature();
+ entry.put(isSupported + " (Java " + javaMajorVersion + ")", 1);
+
+ virtualThreadSupportMap.put(String.valueOf(isSupported), entry);
+ }
+ metrics.addCustomChart(new Metrics.DrilldownPie("virtual_thread_support", () -> virtualThreadSupportMap));
+ // Gale end - virtual thread support - include in metrics
+
}
}