Home / Function/ trySuspend() — netty Function Reference

trySuspend() — netty Function Reference

Architecture documentation for the trySuspend() function in SingleThreadEventExecutor.java from the netty codebase.

Function java CommonUtil Concurrent calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  a4b61d3b_50c5_e24e_858c_83456faa0c45["trySuspend()"]
  c9189467_acbc_07ea_3a8c_fecfe22ec122["SingleThreadEventExecutor"]
  a4b61d3b_50c5_e24e_858c_83456faa0c45 -->|defined in| c9189467_acbc_07ea_3a8c_fecfe22ec122
  d19115ba_3182_5468_97c7_239c6acc4a73["scheduleRemoveScheduled()"]
  d19115ba_3182_5468_97c7_239c6acc4a73 -->|calls| a4b61d3b_50c5_e24e_858c_83456faa0c45
  a1d3a8d1_9238_e4b8_bc99_db8bd82af78f["wakeup()"]
  a4b61d3b_50c5_e24e_858c_83456faa0c45 -->|calls| a1d3a8d1_9238_e4b8_bc99_db8bd82af78f
  957fd634_92d8_ad7a_8d3f_c6d9e5d7ee2a["inEventLoop()"]
  a4b61d3b_50c5_e24e_858c_83456faa0c45 -->|calls| 957fd634_92d8_ad7a_8d3f_c6d9e5d7ee2a
  style a4b61d3b_50c5_e24e_858c_83456faa0c45 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java lines 871–884

    @Override
    public boolean trySuspend() {
        if (supportSuspension) {
            if (STATE_UPDATER.compareAndSet(this, ST_STARTED, ST_SUSPENDING)) {
                wakeup(inEventLoop());
                return true;
            } else if (STATE_UPDATER.compareAndSet(this, ST_NOT_STARTED, ST_SUSPENDED)) {
                return true;
            }
            int currentState = state;
            return currentState == ST_SUSPENDED || currentState == ST_SUSPENDING;
        }
        return false;
    }

Domain

Subdomains

Frequently Asked Questions

What does trySuspend() do?
trySuspend() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java.
Where is trySuspend() defined?
trySuspend() is defined in common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java at line 871.
What does trySuspend() call?
trySuspend() calls 2 function(s): inEventLoop, wakeup.
What calls trySuspend()?
trySuspend() is called by 1 function(s): scheduleRemoveScheduled.

Analyze Your Own Codebase

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

Try Supermodel Free