Skip to content

AsyncReaderWriterLock may ignore CancellationToken, when it is cancelled. #200

Description

@lifengl

The Awaiter.OnCompleted has a potential race condition:
When the cancellation token is cancelled after IsCompueted is called, but before (or in the middle of) cancellationToken.Register is called (in the middle of OnCompleted function). The call back will not be registered, but will be called in the middle of the cancellationToken.Register function. Because the request is not yet in the queue at that point, CancellationResponder will do nothing, and the lock request will be put into the waiting queue.

This can potentially introduce dead locks in the product, when the cancellationToken is triggered during unloading.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions