Home / Function/ testToStringMultipleThreads0() — netty Function Reference

testToStringMultipleThreads0() — netty Function Reference

Architecture documentation for the testToStringMultipleThreads0() function in AbstractByteBufTest.java from the netty codebase.

Function java Buffer Search called by 1

Entity Profile

Dependency Diagram

graph TD
  8fdc6518_f9ec_9766_1a54_c1648fae6142["testToStringMultipleThreads0()"]
  6540f2d1_cdad_6705_dd1d_9a24e2e53242["AbstractByteBufTest"]
  8fdc6518_f9ec_9766_1a54_c1648fae6142 -->|defined in| 6540f2d1_cdad_6705_dd1d_9a24e2e53242
  433d1f91_0210_b4e0_aad7_4e4c16dc37b6["testToStringMultipleThreads()"]
  433d1f91_0210_b4e0_aad7_4e4c16dc37b6 -->|calls| 8fdc6518_f9ec_9766_1a54_c1648fae6142
  style 8fdc6518_f9ec_9766_1a54_c1648fae6142 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/AbstractByteBufTest.java lines 2302–2335

    static void testToStringMultipleThreads0(final ByteBuf buffer) throws Throwable {
        final String expected = buffer.toString(CharsetUtil.ISO_8859_1);

        final AtomicInteger counter = new AtomicInteger(30000);
        final AtomicReference<Throwable> errorRef = new AtomicReference<Throwable>();
        List<Thread> threads = new ArrayList<Thread>();
        for (int i = 0; i < 10; i++) {
            Thread thread = new Thread(new Runnable() {
                @Override
                public void run() {
                    try {
                        while (errorRef.get() == null && counter.decrementAndGet() > 0) {
                            assertEquals(expected, buffer.toString(CharsetUtil.ISO_8859_1));
                        }
                    } catch (Throwable cause) {
                        errorRef.compareAndSet(null, cause);
                    }
                }
            });
            threads.add(thread);
        }
        for (Thread thread : threads) {
            thread.start();
        }

        for (Thread thread : threads) {
            thread.join();
        }

        Throwable error = errorRef.get();
        if (error != null) {
            throw error;
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testToStringMultipleThreads0() do?
testToStringMultipleThreads0() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/AbstractByteBufTest.java.
Where is testToStringMultipleThreads0() defined?
testToStringMultipleThreads0() is defined in buffer/src/test/java/io/netty/buffer/AbstractByteBufTest.java at line 2302.
What calls testToStringMultipleThreads0()?
testToStringMultipleThreads0() is called by 1 function(s): testToStringMultipleThreads.

Analyze Your Own Codebase

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

Try Supermodel Free