Home / Function/ runWithFastThreadLocal() — netty Function Reference

runWithFastThreadLocal() — netty Function Reference

Architecture documentation for the runWithFastThreadLocal() function in FastThreadLocalThread.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  975ee699_9cd3_a96e_0cf6_88607760d9ab["runWithFastThreadLocal()"]
  2feb1cd5_2395_f297_19e0_09fabbc500ff["FastThreadLocalThread"]
  975ee699_9cd3_a96e_0cf6_88607760d9ab -->|defined in| 2feb1cd5_2395_f297_19e0_09fabbc500ff
  3b1a506e_9004_a3cf_45ac_f08e7950c618["contains()"]
  975ee699_9cd3_a96e_0cf6_88607760d9ab -->|calls| 3b1a506e_9004_a3cf_45ac_f08e7950c618
  style 975ee699_9cd3_a96e_0cf6_88607760d9ab fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/concurrent/FastThreadLocalThread.java lines 163–182

    public static void runWithFastThreadLocal(Runnable runnable) {
        Thread current = currentThread();
        if (current instanceof FastThreadLocalThread) {
            throw new IllegalStateException("Caller is a real FastThreadLocalThread");
        }
        long id = current.getId();
        fallbackThreads.updateAndGet(set -> {
            if (set.contains(id)) {
                throw new IllegalStateException("Reentrant call to run()");
            }
            return set.add(id);
        });

        try {
            runnable.run();
        } finally {
            fallbackThreads.getAndUpdate(set -> set.remove(id));
            FastThreadLocal.removeAll();
        }
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does runWithFastThreadLocal() do?
runWithFastThreadLocal() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/concurrent/FastThreadLocalThread.java.
Where is runWithFastThreadLocal() defined?
runWithFastThreadLocal() is defined in common/src/main/java/io/netty/util/concurrent/FastThreadLocalThread.java at line 163.
What does runWithFastThreadLocal() call?
runWithFastThreadLocal() calls 1 function(s): contains.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free