Uploaded image for project: 'Byteman'
  1. Byteman
  2. BYTEMAN-43

Waiter.waitFor() sometimes appears signalled without actually having been signalled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.3.CP01, 1.1.1
    • None
    • None
    • None

      This appears to be caused by the following from Object.wait() javadoc, and happens relatively frequently on JDK 6 on OS X Snow Leopard:

      A thread can also wake up without being notified, interrupted, or timing out, a so-called spurious wakeup. While this will rarely occur in practice, applications must guard against it by testing for the condition that should have caused the thread to be awakened, and continuing to wait if the condition is not satisfied. In other words, waits should always occur in loops, like this one:

      synchronized (obj)

      { while (<condition does not hold>) obj.wait(timeout); ... // Perform action appropriate to condition }

            rhn-engineering-adinn Andrew Dinn
            kkhan1@redhat.com Kabir Khan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: