Skip to content

WaitHandles: Possible race condition in InternalWaitOneAsync() #120

@madelson

Description

@madelson

Referring to https://github.com/madelson/DistributedLock/blob/master/DistributedLock.WaitHandles/WaitHandleExtensions.cs#L43

Consider the following case:

  • CancellationToken fires and sets the task to canceled
  • WaitForSingleObject callback runs and fails to set the task

In that case, I think we lose a signal on the handle; ideally if the wait callback fails to set the task then it should re-signal the event.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions