Closed cretz closed 2 months ago
Would it make sense to add support for using this withing a using block
In this case we are matching existing .NET APIs which do not leverage IDisposable
to release mutexes/semaphores. I think .NET chose explicit release vs using block (akin to a Rust guard) for .NET developers to be clear about when to release (may not otherwise be clear especially for those with using
as a statement instead of a block).
Would it make sense to add support for using this withing a using block
In this case we are matching existing .NET APIs which do not leverage
IDisposable
to release mutexes/semaphores. I think .NET chose explicit release vs using block (akin to a Rust guard) for .NET developers to be clear about when to release (may not otherwise be clear especially for those withusing
as a statement instead of a block).
FYI it very much does work with disposable https://learn.microsoft.com/en-us/dotnet/api/system.threading.mutex?view=net-8.0#remarks
What was changed
Added
Temporalio.Workflows.Mutex
which is a thin layer over the semaphore