aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/util/sys
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2018-05-29 19:10:36 +1000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2018-05-29 19:10:36 +1000
commit29258132152e2b0b6670fffc366598ccc2b00351 (patch)
tree5cb2e3e71b7e95f5b0a5838d2ba0b1247a38e5e6 /src/Java/gtPlusPlus/core/util/sys
parent272cd6156d1dc92985b613511b4cae62ef516bb1 (diff)
downloadGT5-Unofficial-29258132152e2b0b6670fffc366598ccc2b00351.tar.gz
GT5-Unofficial-29258132152e2b0b6670fffc366598ccc2b00351.tar.bz2
GT5-Unofficial-29258132152e2b0b6670fffc366598ccc2b00351.zip
+ Added a display string to the GUI of the threaded buffers, showing seconds remaining before the thread belonging to this buffer is released. This will also show ms/25 lag info someday.
+ Added invokeGC() to SystemUtils.java. $ More thread safety.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/sys')
-rw-r--r--src/Java/gtPlusPlus/core/util/sys/SystemUtils.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/util/sys/SystemUtils.java b/src/Java/gtPlusPlus/core/util/sys/SystemUtils.java
index efcfaf8d04..2788ba688e 100644
--- a/src/Java/gtPlusPlus/core/util/sys/SystemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/sys/SystemUtils.java
@@ -14,6 +14,19 @@ public class SystemUtils {
}
}
+ /**
+ * Try invoke the runtime's Garbage Collector.
+ */
+ public static void invokeGC() {
+ try {
+ Runtime r = Runtime.getRuntime();
+ r.gc();
+ }
+ catch (Throwable t) {
+ //Do nothing.
+ }
+ }
+
public static boolean isWindows() {
return (getOSString().indexOf("win") >= 0);
}