3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-06 00:00:47 +01:00
Dieser Commit ist enthalten in:
Andrew Steinborn 2024-10-12 18:21:01 -04:00
Ursprung ae12c478ca
Commit 8971dbe3c3

Datei anzeigen

@ -73,7 +73,6 @@ public enum TransportType {
final ChannelFactory<? extends SocketChannel> socketChannelFactory; final ChannelFactory<? extends SocketChannel> socketChannelFactory;
final ChannelFactory<? extends DatagramChannel> datagramChannelFactory; final ChannelFactory<? extends DatagramChannel> datagramChannelFactory;
final Supplier<IoHandlerFactory> ioHandlerFactorySupplier; final Supplier<IoHandlerFactory> ioHandlerFactorySupplier;
volatile IoHandlerFactory ioHandlerFactory;
TransportType(final String name, TransportType(final String name,
final ChannelFactory<? extends ServerSocketChannel> serverSocketChannelFactory, final ChannelFactory<? extends ServerSocketChannel> serverSocketChannelFactory,
@ -99,12 +98,8 @@ public enum TransportType {
* @return the event loop group * @return the event loop group
*/ */
public EventLoopGroup createEventLoopGroup(final Type type) { public EventLoopGroup createEventLoopGroup(final Type type) {
if (this.ioHandlerFactory == null) {
this.ioHandlerFactory = this.ioHandlerFactorySupplier.get();
}
assert this.ioHandlerFactory != null;
return new MultiThreadIoEventLoopGroup( return new MultiThreadIoEventLoopGroup(
0, createThreadFactory(this.name, type), this.ioHandlerFactory); 0, createThreadFactory(this.name, type), this.ioHandlerFactorySupplier.get());
} }
private static ThreadFactory createThreadFactory(final String name, final Type type) { private static ThreadFactory createThreadFactory(final String name, final Type type) {