Skip to content

WaitHandles: Possible race condition in InternalWaitOneAsync() #120

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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