Closed deastr closed 1 year ago
Hello,
Is this a bad idea? I know Dispose is still called with using a discard but I want to be sure with AsyncLock:
if(..) { using var _ = await asyncLock.LockAsync(token); //rest of the if block that needs to be locked }
Yes, that will work fine.
Personally, I prefer the braces, because it makes the "needs to be locked" code very explicit. But it works just as well without the braces.
Hello,
Is this a bad idea? I know Dispose is still called with using a discard but I want to be sure with AsyncLock: