Exemplo n.º 1
0
        private static async void AcquireWeakLock(AsyncSharedLock sharedLock, AsyncCountdownEvent acquireEvent)
        {
            await sharedLock.Acquire(false, CancellationToken.None);

            acquireEvent.Signal();
        }
Exemplo n.º 2
0
        private static async void AcquireWeakLockAndRelease(AsyncSharedLock sharedLock, AsyncCountdownEvent acquireEvent)
        {
            await Task.Delay(100);

            await sharedLock.Acquire(false, TimeSpan.Zero);

            acquireEvent.Signal();
            await Task.Delay(100);

            sharedLock.Release();
        }