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

Cleanup TaskQueueSuper<>::peek

XMLWordPrintable

    • gc
    • b22

      The TaskQueueSuper<>::peek function simply returns true if the queue's top and bottom differ. This means it is not being careful with the underflow possible during concurrent pop_local and pop_global.

      However, it appears to only be used in assertions to verify the queue is empty after a successful termination negotiation. In that case a temporary underflow can't be happening because there shouldn't be any pop_local or pop_global operations in progress.

      So while the current implementation suffices, it would be better to have a debug-only operation with a name (and possibly behavior) more suited to its usage.

            kbarrett Kim Barrett
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: