Switch lock backport package to #if defs instead#3217
Conversation
|
The package is set to run in source generator mode, which means that it won't actually add a dependency. |
|
Not formally no but from what I can tell it just copies the runtime package into the source of the project. |
|
Right, but those directives are both an eyesore and limiting in scope. Yes, currently only the lock keyword is used but the polyfill allows for using the whole API. For starters, using the preprocessor directives won't allow you to lock with a timeout, or you'd have to use preprocessor directives on the timeout lock call too. |
The addition of a new package and the details surrounding that new package somewhat irks me, so this PR removes said new package and replaces it with some simple
#if NET9_0_OR_GREATERs. Should accomplish the same thing but without adding new stuff to the csproj.