Esempio n. 1
0
 internal LockReleaser(AsyncLock target)
 {
     this.target = target;
 }
Esempio n. 2
0
 internal LockReleaser(AsyncLock target)
 {
     this.target = target;
 }
Esempio n. 3
0
                static async ValueTask <IDisposable> LockAsyncInternal(AsyncLock self, Task waitTask)
                {
                    await waitTask.ConfigureAwait(false);

                    return(new LockReleaser(self));
                }
Esempio n. 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
            }