Example usage for io.netty.util.concurrent FastThreadLocal FastThreadLocal

List of usage examples for io.netty.util.concurrent FastThreadLocal FastThreadLocal

Introduction

In this page you can find the example usage for io.netty.util.concurrent FastThreadLocal FastThreadLocal.

Prototype

public FastThreadLocal() 

Source Link

Usage

From source file:org.apache.cassandra.io.compress.DeflateCompressor.java

License:Apache License

private DeflateCompressor() {
    deflater = new FastThreadLocal<Deflater>() {
        @Override/*  www.  j av a  2s  .com*/
        protected Deflater initialValue() {
            return new Deflater();
        }
    };
    inflater = new FastThreadLocal<Inflater>() {
        @Override
        protected Inflater initialValue() {
            return new Inflater();
        }
    };
}

From source file:org.lanternpowered.server.util.FastSoftThreadLocal.java

License:MIT License

/**
 * Creates a thread local variable.
 *
 * @see #withInitial(Supplier)
 */
public FastSoftThreadLocal() {
    this(new FastThreadLocal<>());
}

From source file:org.lanternpowered.server.util.FastThreadLocals.java

License:MIT License

public static <S> FastThreadLocal<S> withInitial(Supplier<? extends S> supplier) {
    return new FastThreadLocal<S>() {
        @Override//from ww  w.  ja va  2 s. c om
        protected S initialValue() throws Exception {
            return supplier.get();
        }
    };
}