/// <summary> /// Creates an async-compatible countdown event. /// </summary> /// <param name="count">The number of signals this event will need before it becomes set. Must be greater than zero.</param> public AsyncCountdownEvent(int count) { _tcs = new TaskCompletionSource(); _count = count; //Enlightenment.Trace.AsyncCountdownEvent_CountChanged(this, -1, count); }
/// <summary> /// Initializes a new instance of the <see cref="TaskCompletionSource"/> class with the specified state and options. /// </summary> /// <param name="state">The state to use as the underlying <see cref="Task"/>'s <see cref="IAsyncResult.AsyncState"/>.</param> /// <param name="creationOptions">The options to use when creating the underlying <see cref="Task"/>.</param> public TaskCompletionSource(object state, TaskCreationOptions creationOptions) { _tcs = new TaskCompletionSource<object>(state, creationOptions); }
/// <summary> /// Initializes a new instance of the <see cref="TaskCompletionSource"/> class with the specified state. /// </summary> /// <param name="state">The state to use as the underlying <see cref="Task"/>'s <see cref="IAsyncResult.AsyncState"/>.</param> public TaskCompletionSource(object state) { _tcs = new TaskCompletionSource<object>(state); }
/// <summary> /// Initializes a new instance of the <see cref="TaskCompletionSource"/> class with the specified options. /// </summary> /// <param name="creationOptions">The options to use when creating the underlying <see cref="Task"/>.</param> public TaskCompletionSource(TaskCreationOptions creationOptions) { _tcs = new TaskCompletionSource<object>(creationOptions); }
/// <summary> /// Initializes a new instance of the <see cref="TaskCompletionSource"/> class. /// </summary> public TaskCompletionSource() { _tcs = new TaskCompletionSource<object>(); }