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

(thread) Thread safety of Thread get/setName()

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b93
    • Verification:
      Not verified

      Description

      see discussion on concurrency-interest mailing list;
        http://cs.oswego.edu/pipermail/concurrency-interest/2013-March/010935.html

      java.lang.Thread

          private char name[];

          public final void setName(String name) {
              checkAccess();
              this.name = name.toCharArray();
          }

          public final String getName() {
              return String.valueOf(name);
          }

      On the surface, set/getName() are not correctly synchronized,
      getName() could observe a partially filled char array

        Attachments

          Activity

            People

            Assignee:
            chegar Chris Hegarty
            Reporter:
            chegar Chris Hegarty
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: