Skip to content

Commit

Permalink
feat: имена потоков
Browse files Browse the repository at this point in the history
- добавлены имена для потоков CallbackHelper
  • Loading branch information
Reider745 committed Dec 19, 2023
1 parent 48ec25e commit 4a1a042
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/reider745/api/CallbackHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public void run() {

public static void registerCallback(Type type) {
ThreadRegion threadRegion = new ThreadRegion();
threadRegion.setName(type.name());
threadRegion.start();

types.put(type, threadRegion);
Expand Down Expand Up @@ -130,6 +131,7 @@ public static void applyRegion(Type type, Level level, ICallbackApply apply) {

public static void apply(Event event, ICallbackApply apply, boolean isPrevented) {
Thread thread = new ThreadCallbackEvent(event, apply, isPrevented);
thread.setName(event.getEventName());
thread.start();
while (thread.isAlive()) {
}
Expand Down

0 comments on commit 4a1a042

Please sign in to comment.