26 owner.
Trace($
"{name}. {"initialCredit
"}={initialCredit}",
".ctor");
44 _owner.
Trace($
"{_name}. requested={amount}, no credit available.",
"RequestCreditAsync");
47 creditWaiter.Amount = amount;
55 _waitersTail.Next = creditWaiter;
68 _owner.
Trace($
"{_name}. {"amount
"}={amount}, current={_current}",
"AdjustCredit");
82 if (next.
Next == next)
88 _waitersTail.Next = next.
Next;
110 if (creditWaiter !=
null)
115 creditWaiter.Next =
null;
136 _owner.
Trace($
"{_name}. requested={amount}, current={_current}, granted={num}",
"TryRequestCreditNoLock");
static byte Min(byte val1, byte val2)
ValueTask< int > RequestCreditAsync(int amount, CancellationToken cancellationToken)
CreditWaiter _waitersTail
int TryRequestCreditNoLock(int amount)
void AdjustCredit(int amount)
readonly IHttpTrace _owner
CreditManager(IHttpTrace owner, string name, int initialCredit)
ValueTask< int > AsValueTask()
bool TrySetResult(int result)
static readonly System.Net.NetEventSource Log
static bool Read(ref bool location)
void Trace(string message, [CallerMemberName] string memberName=null)