Skip to content

CoroSemaphore Timing Issue #23

@Aidan63

Description

@Aidan63

I've not yet fully convinced myself but I think there's a potential timing issue with the dequeMutex in CoroSemaphore. Specifically around changing the value of the atomic free and then acquiring the dequeMutex.
I think we could potentially run into an issue where acquire writes to free and then needs to suspend, but before that acquire call locks the muxtex release reads and modifies free which indicates there is a suspended continuation and managed to acquire the mutex first. In this case it won't find a continuation to resume, so have we now become out of sync between the free count and number of suspended continuations?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions