Ejemplo n.º 1
0
            internal CustomSocketAsyncEventArgs(
                Func <SocketAsyncEventArgs, TResult> endCallback,
                Action <SocketAsyncEventArgs> cancelCallback,
                CancellationToken cancellationToken)
            {
                EndCallback       = endCallback;
                CancelCallback    = cancelCallback;
                CancellationToken = cancellationToken;

                TaskHandle = CreateTaskHandle <TResult>();
            }
Ejemplo n.º 2
0
            public bool TryExtract(out TArg arg, out ValueTaskHandle <TResult> taskHandle, out CancellationToken cancellationToken)
            {
                var content = Interlocked.Exchange(ref _content, null);

                if (content != null)
                {
                    content.Return(out arg, out taskHandle, out cancellationToken);
                    return(true);
                }
                else
                {
                    (arg, taskHandle, cancellationToken) = (default !, default, default);
 internal Lending(LendingData data, ValueTaskHandle <Unit> disposedTaskHandle)
 {
     _data = data;
     _disposedTaskHandle = disposedTaskHandle;
 }
Ejemplo n.º 4
0
 internal Entry(TArg arg, ValueTaskHandle <TResult> taskHandle, CancellationToken cancellationToken)
 {
     _content = new Content(arg, taskHandle, cancellationToken.Register(OnCanceled, this));
 }