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

2.0cb: redundant/nested synchronization

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.1
    • 2.0
    • hotspot
    • None
    • beta
    • x86
    • generic

      This program is not getting compiled:

      class SynchSpeed2 {
        public static void main(String[] args) {
          SynchSpeed2 obj = new SynchSpeed2();
          for (int i = 0; i < 10000000; i++) {
            synchronized(obj){};
            synchronized(obj){};
          }
        }
      }

      while this program is compiled:

      class SynchSpeed1 {
        public static void main(String[] args) {
          SynchSpeed1 obj = new SynchSpeed1();
          for (int i = 0; i < 10000000; i++) {
            synchronized(obj){};
          }
        }
      }

            tturnidgsunw Todd Turnidge (Inactive)
            mpalecznsunw Michael Paleczny (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: