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

ServerSocket is not thread safe

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 18
    • Fix Version/s: 18
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b27

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: