-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Directly returning the KeyedLock.Entry is efficient (no extra GC pressure), but allows for potential misuse if someone keeps a reference to it. They could call Dispose multiple times (or none).
We should probably return a wrapper class instead, so we can throw an exception if Dispose is called a second time.
Not sure what to do if they aren't calling Dispose at all, then their locks will stay locked forever and cause a memory leak...
Alternative: make all fields internal (on KeyedLock.Entry and add an analyzer that warns about putting it in a variable instead of a direct using statement.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels