コード例 #1
0
        private async Task <NmsLock> TryEnterAsync(int timeout, NmsLock nmsLock)
        {
            try
            {
                nmsLock = await nmsLock.EnterAsync(timeout).Await();

                return(nmsLock);
            }
            catch (Exception)
            {
                return(null);
            }
        }
コード例 #2
0
        LockAsync()     // This should not be async method, cause setting asyncLocal inside GetOrCreateCurrentLock may be only limited to this method in such case
        {
            NmsLock nmsLock = GetOrCreateCurrentLock();

            return(nmsLock.EnterAsync());
        }