tonybaloney / CSnakes

Embed Python in .NET
https://tonybaloney.github.io/CSnakes/
MIT License
343 stars 24 forks source link

Use `System.Threading.Lock` on .NET 9. #289

Closed AaronRobinsonMSFT closed 1 month ago

AaronRobinsonMSFT commented 1 month ago

Alternative proposal to https://github.com/tonybaloney/CSnakes/pull/263.

AaronRobinsonMSFT commented 1 month ago

/cc @MarkCiliaVincenti

MarkCiliaVincenti commented 1 month ago

Works, but please refer to https://github.com/MarkCiliaVincenti/Backport.System.Threading.Lock?tab=readme-ov-file#why-not-keep-it-simple

aaronpowell commented 1 month ago

I'm inclined to go with this approach rather than bringing in an external dependency like #263 does primarily because we're not likely to leverage the methods that the .NET 9 Lock type introduces - unless you can see areas in which we could benefit from it @MarkCiliaVincenti so I can better understand what limitations we might have in our current design.

MarkCiliaVincenti commented 1 month ago

Nothing in particular, as long as you're aware. Should you need you can then easily switch to the version that uses the backport.

AaronRobinsonMSFT commented 1 month ago

@aaronpowell or @tonybaloney Either of you want to sign off on this so we can get it in?