Skip to content

Checking field WebSocketImpl.readyState is non thread-safe #808

@fightyz

Description

@fightyz

The writing of field WebSockdtImpl.readyState is synchronized in close methods. The checking method, like WebSocketImpl.isOpen(), isClosing() etc., should also be synchronized. Because these methods may be called in any other thread, and the thread could see a local copy of the variable readyState. The simplest way is adding a key word volatile to readyState.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions