Skip to content

Commit

Permalink
chore[virtual]: mark java 21 code
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Sep 21, 2023
1 parent eeefb69 commit ce9cc21
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions event/src/main/java/com/zfoo/event/manager/EventBus.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public static void post(IEvent event) {
switch (receiver.bus()) {
case CurrentThread -> doReceiver(receiver, event);
case AsyncThread -> execute(event.executorHash(), () -> doReceiver(receiver, event));
// case VirtualThread -> Thread.ofVirtual().name("virtual-on" + clazz.getSimpleName()).start(() -> doReceiver(receiver, event));
}
}
}
Expand Down
1 change: 1 addition & 0 deletions net/src/main/java/com/zfoo/net/router/Router.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ public void dispatchByTaskExecutorHash(int taskExecutorHash, PacketReceiverTask
switch (receiver.task()) {
case TaskBus -> TaskBus.execute(taskExecutorHash, packetReceiverTask);
case NettyIO -> atReceiver(packetReceiverTask);
// case VirtualThread -> Thread.ofVirtual().name("virtual-at" + clazz.getSimpleName()).start(() -> atReceiver(packetReceiverTask));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ protected T initialValue() {
}

public T get() {
// return Thread.currentThread().isVirtual() ? supplier.get() : fastThreadLocal.get();
return fastThreadLocal.get();
}
}

0 comments on commit ce9cc21

Please sign in to comment.