From a11816884cb51213a8d7d20c4afb68b9e498de44 Mon Sep 17 00:00:00 2001 From: Glavo Date: Thu, 24 Oct 2024 01:01:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=20@FXThread=20=E6=B3=A8?= =?UTF-8?q?=E8=A7=A3=20(#3374)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jackhuang/hmcl/util/FXThread.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 HMCLCore/src/main/java/org/jackhuang/hmcl/util/FXThread.java diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/FXThread.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/FXThread.java new file mode 100644 index 000000000..53974cb0a --- /dev/null +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/FXThread.java @@ -0,0 +1,32 @@ +/* + * Hello Minecraft! Launcher + * Copyright (C) 2024 huangyuhui and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.jackhuang.hmcl.util; + +import java.lang.annotation.*; + +/** + * Mark a method that can only be called on the JavaFX Application Thread, + * or mark a field that can only be read/modified on the JavaFX Application Thread. + * + * @author Glavo + */ +@Documented +@Target({ElementType.METHOD, ElementType.FIELD}) +@Retention(RetentionPolicy.SOURCE) +public @interface FXThread { +}