Home / Class/ Worker Class — netty Architecture

Worker Class — netty Architecture

Architecture documentation for the Worker class in FastThreadLocalTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  c5fd914c_a776_01bd_c9fb_0cf5b89e7a40["Worker"]
  8487d652_7084_0729_ca43_9b105405e7a0["FastThreadLocalTest.java"]
  c5fd914c_a776_01bd_c9fb_0cf5b89e7a40 -->|defined in| 8487d652_7084_0729_ca43_9b105405e7a0
  7fb6cd58_f112_73b3_6216_2819f285c975["run()"]
  c5fd914c_a776_01bd_c9fb_0cf5b89e7a40 -->|method| 7fb6cd58_f112_73b3_6216_2819f285c975

Relationship Graph

Source Code

common/src/test/java/io/netty/util/concurrent/FastThreadLocalTest.java lines 202–221

        class Worker implements Runnable {
            final Semaphore semaphore = new Semaphore(0);
            final FutureTask<?> task = new FutureTask<>(this, null);

            @Override
            public void run() {
                assertFalse(FastThreadLocalThread.currentThreadWillCleanupFastThreadLocals());
                assertFalse(FastThreadLocalThread.currentThreadHasFastThreadLocal());
                semaphore.acquireUninterruptibly();
                FastThreadLocalThread.runWithFastThreadLocal(() -> {
                    assertTrue(FastThreadLocalThread.currentThreadWillCleanupFastThreadLocals());
                    assertTrue(FastThreadLocalThread.currentThreadHasFastThreadLocal());
                    semaphore.acquireUninterruptibly();
                    assertTrue(FastThreadLocalThread.currentThreadWillCleanupFastThreadLocals());
                    assertTrue(FastThreadLocalThread.currentThreadHasFastThreadLocal());
                });
                assertFalse(FastThreadLocalThread.currentThreadWillCleanupFastThreadLocals());
                assertFalse(FastThreadLocalThread.currentThreadHasFastThreadLocal());
            }
        }

Frequently Asked Questions

What is the Worker class?
Worker is a class in the netty codebase, defined in common/src/test/java/io/netty/util/concurrent/FastThreadLocalTest.java.
Where is Worker defined?
Worker is defined in common/src/test/java/io/netty/util/concurrent/FastThreadLocalTest.java at line 202.

Analyze Your Own Codebase

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

Try Supermodel Free