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

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

XMLWordPrintable

    • b93
    • Not verified

      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

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

              Created:
              Updated:
              Resolved: