Skip to content

Conversation

@AnyhowStep
Copy link

@AnyhowStep AnyhowStep commented Jul 23, 2025

Resolves #2

We store a copy of the CancellationToken in the Cache's ctor.
Then, we use that inside of CleanupLoop(), and never reference _cts directly.

This way, we avoid having ObjectDisposedException thrown when Dispose() is invoked before IsCancellationRequested check and Task.Delay().

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.

Race condition between Cache Dispose(bool disposing) and CleanupLoop()

1 participant