Пример #1
0
 internal LockReleaser(AsyncLock target)
 {
     this.target = target;
 }
Пример #2
0
 internal LockReleaser(AsyncLock target)
 {
     this.target = target;
 }
Пример #3
0
                static async ValueTask <IDisposable> LockAsyncInternal(AsyncLock self, Task waitTask)
                {
                    await waitTask.ConfigureAwait(false);

                    return(new LockReleaser(self));
                }
Пример #4
0
            public void Dispose()
            {
                if (target == null)
                    return;

                // first null it, next Release, so even if Release throws, we don't hold the reference any more.
                AsyncLock tmp = target;
                target = null;
                try
                {
                    tmp.semaphore.Release();
                }
                catch (Exception) { } // just ignore the Exception
            }