Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added timeout to WaitAsync method #125

Closed

Conversation

nzaugg
Copy link

@nzaugg nzaugg commented Mar 6, 2018

Renamed the _mutex variable to _syncRoot, as it's actually a sync root for a monitor lock and is not an actual mutex

Renamed the _mutex variable to _syncRoot, as it's actually a sync root for a monitor lock and is not an actual mutex
@StephenCleary StephenCleary self-assigned this Mar 16, 2018
@StephenCleary
Copy link
Owner

Hello, nzaugg,

Thank you for the pull request. However, not having int/TimeSpan timeout overloads is a deliberate decision. The AsyncEx way of doing timeouts is to use CancellationTokens.

On a side note, your implementation would use a single timer for the entire AsyncManualResetEvent instance, which would have incorrect semantics. You'd need a timer per method call so that the timer isn't shared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants