Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8278270

ServerSocket is not thread safe

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 18
    • 18
    • core-libs
    • None
    • b27

        There are several thread safety issues in java.net.ServerSocket. These can be fixed by:

        1. Changing impl to be a final field.
        2. Promote closeLock to be a general "state lock" and require it to set the (volatile) created, bound, and closed fields.
        3. Use the state lock when binding so that it can coordinate with async close of the ServerSocket.

              alanb Alan Bateman
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: