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

JNI specification should discuss multiple invocations of DetachCurrentThread

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 7
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      A DESCRIPTION OF THE REQUEST :
      The JNI speciifcation should explicitly discuss what happens if a user invokes DetachCurrentThread() on a thread that is already detached (or has never been attached). I have seen at least one implementation that would crash when this happens.

      The specification should also discuss what happens if the user invokes:

      attach, attach
      detach, detach

      Is the thread still attached before the 2nd detach() call? That is, is there a reference count and the thread is only attached when the count drops to zero? Or is the thread detached the first time detach() is called regardless of how many times attach() was called?

      Again, I have seen an implementation in that differs from Sun's and it led to problems.

      JUSTIFICATION :
      Improve JNI code portability by clarifying this hole in the specification

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dsimms David Simms
                Reporter:
                ryeung Roger Yeung (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: