private void OnAssignedImpl() // make sure this happens on the
            {                             // scheduler's thread to avoid the release thread being stolen
                var token = LockState.GetResult(ref _token);

                if (LockState.GetState(token) == LockState.Canceled)
                {
                    TrySetCanceled();
                }
                else
                {
                    TrySetResult(new LockToken(_mutex, token));
                }
            }
Beispiel #2
0
 internal int GetResult() => LockState.GetResult(ref _token);
 int IPendingLockToken.GetResult(short key) => LockState.GetResult(ref _token);
Beispiel #4
0
 LockToken IValueTaskSource <LockToken> .GetResult(short key) => new LockToken(_mutex, LockState.GetResult(ref _tokens[key]));