Skip to content

There may be a bug of scan loop condition. #4

@CxdInitial

Description

@CxdInitial

Hey @DolevAdas , I have read the dequeue method, but there is one thing that confused me a lot. See the scan loop condition below:

for (unsigned int scanHead = scanHeadOfQueue->head; ( scanHeadOfQueue != tempHeadOfQueue || scanHead < (tempHead-1) && n->is_set.load(std::memory_order_acquire) == 0); scanHead++)

I think it should be:
( (scanHeadOfQueue != tempHeadOfQueue || scanHead < (tempHead-1)) && n->is_set.load(std::memory_order_acquire) == 0)

The original scan loop condition makes the loop continue to run even if n->is_set.load(std::memory_order_acquire) != 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions