Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-334

map.StaticBucketMap.size() needs to synchronize access to lock

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.2.2, 4.0-alpha1, 4.0
    • Collection
    • None
    • collections_jdk5_branch

    Description

      The field Lock.size is updated using synchronization, however the StaticBucketMap.size() method reads the values without synch.

      If the read is done in a different thread from the updates, there is no guarantee that the reading thread will see the most recent value.

      Attachments

        Activity

          People

            jochen@apache.org Jochen Wiedmann
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: