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

Runtime.runFinalization() silently clears interrupted flag in the calling thread

    Details

    • Subcomponent:
    • Resolved In Build:
      b39
    • CPU:
      generic, x86
    • OS:
      generic, linux, windows_nt
    • Verification:
      Verified

      Backports

        Description

        Name: skT45625 Date: 07/19/2000


        java version "1.2.2"
        Classic VM (build JDK-1.2.2-004, native threads, symcjit)

        If the thread which is already interrupted by another thread, calls
        Runtime.getRuntime().runFinalization(), the interrupted status of the thread is
        cleared (and API documentation doesn't say anything about it).
        Sample code (my thread is already interrupted by another thread, before getting
        here):

        Runtime rt = Runtime.getRuntime();
        System.out.println("Status: "+ Thread.currentThread().isInterrupted());
        rt.runFinalization();
        System.out.println("Status: "+ Thread.currentThread().isInterrupted());

        will print to console:

        Status: true
        Status: false
        (Review ID: 107365)
        ======================================================================

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  smarks Stuart Marks
                  Reporter:
                  skondamasunw Suresh Kondamareddy (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: