Home / Function/ testMultipleRecycleAtDifferentThread() — netty Function Reference

testMultipleRecycleAtDifferentThread() — netty Function Reference

Architecture documentation for the testMultipleRecycleAtDifferentThread() function in RecyclerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  70ad432e_c700_e50e_aafa_660bf5f58122["testMultipleRecycleAtDifferentThread()"]
  46ac14b1_2382_5afa_98f3_803182070b38["RecyclerTest"]
  70ad432e_c700_e50e_aafa_660bf5f58122 -->|defined in| 46ac14b1_2382_5afa_98f3_803182070b38
  87dca999_f804_a974_e326_fd8f527f1246["newRecycler()"]
  70ad432e_c700_e50e_aafa_660bf5f58122 -->|calls| 87dca999_f804_a974_e326_fd8f527f1246
  43ab40f6_52e7_0fe9_a79f_220021939268["recycle()"]
  70ad432e_c700_e50e_aafa_660bf5f58122 -->|calls| 43ab40f6_52e7_0fe9_a79f_220021939268
  style 70ad432e_c700_e50e_aafa_660bf5f58122 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/test/java/io/netty/util/RecyclerTest.java lines 244–278

    @ParameterizedTest
    @EnumSource(OwnerType.class)
    public void testMultipleRecycleAtDifferentThread(OwnerType ownerType)
            throws InterruptedException {
        // This test makes only sense for guarded recyclers
        Recycler<HandledObject> recycler = newRecycler(ownerType, false, 1024);
        final HandledObject object = recycler.get();
        final AtomicReference<IllegalStateException> exceptionStore = new AtomicReference<IllegalStateException>();
        final Thread thread1 = newThread(new Runnable() {
            @Override
            public void run() {
                object.recycle();
            }
        });
        thread1.start();
        thread1.join();

        final Thread thread2 = newThread(new Runnable() {
            @Override
            public void run() {
                try {
                    object.recycle();
                } catch (IllegalStateException e) {
                    exceptionStore.set(e);
                }
            }
        });
        thread2.start();
        thread2.join();
        HandledObject a = recycler.get();
        HandledObject b = recycler.get();
        assertNotSame(a, b);
        IllegalStateException exception = exceptionStore.get();
        assertNotNull(exception);
    }

Domain

Subdomains

Frequently Asked Questions

What does testMultipleRecycleAtDifferentThread() do?
testMultipleRecycleAtDifferentThread() is a function in the netty codebase, defined in common/src/test/java/io/netty/util/RecyclerTest.java.
Where is testMultipleRecycleAtDifferentThread() defined?
testMultipleRecycleAtDifferentThread() is defined in common/src/test/java/io/netty/util/RecyclerTest.java at line 244.
What does testMultipleRecycleAtDifferentThread() call?
testMultipleRecycleAtDifferentThread() calls 2 function(s): newRecycler, recycle.

Analyze Your Own Codebase

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

Try Supermodel Free