Dasync.Collections.Internals.TaskCompletionSource
Utility methods for TaskCompletionSource<T>
Forcibly disables re-use of TaskCompletionSource<T> instances in the Reset<T> method.
This is just a safety switch in case when something goes wrong with re-using instances of TaskCompletionSource<T>.
public static void Reset<T>(ref TaskCompletionSource taskCompletionSource, object stateObject = null)
Resets a TaskCompletionSource<T> to initial incomplete state.
This method by default re-uses the same instance of the TaskCompletionSource<T> by re-setting internal state of its Task using reflection.
If such feature is not available or explicitly disable with the DisableTaskCompletionSourceReUse method, it just returns a new instance of a TaskCompletionSource<T>.