Skip to content

TODO: Fix signal so that this can be an "if" instead of "while" #69

@bullno1

Description

@bullno1

I'm trying to port the spsc queue to use C11 thread and atomic and I encounter this comment:

https://github.com/mattiasgustavsson/libs/blob/main/thread.h#L1401

As far as I can tell, the current signal is already guarding against spurious wake up with a while loop:

https://github.com/mattiasgustavsson/libs/blob/main/thread.h#L970-L974

https://github.com/mattiasgustavsson/libs/blob/main/thread.h#L998-L1008

What else needs to be fixed?
Can this just be switched to if instead?
It saves one atomic load which doesn't seem to be much in the grand scheme of things but still it's something.

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