Speed optimization for .NET 9.0+ through System.Threading.Lock
I have added a net9 build target with automated tests - you can merge master into your changes to get this.
Because System.Threading.Lock is only available on net9, you will need to make this change only for the net9 target using preprocessor directives, you can see a similar example for the lock statement in ConcurrentLfu here https://github.com/bitfaster/BitFaster.Caching/pull/697.
Merged. The preprocessor directives are not needed because this is using a source-generated polyfill.
coverage: 99.062%. first build when pulling ee89e002413d331a0f5652d594b84d748bcfe56d on MarkCiliaVincenti:SystemThreadingLock into 422ab25e421121ab37372df4ecabed41293134a4 on bitfaster:main.
@bitfaster ?