Browse Source

Merge pull request #11194 from robloo/comment-fixes

Fix several issues with comments in Dispatcher.Invoke.cs
pull/11200/head
Max Katz 3 years ago
committed by GitHub
parent
commit
3cf1e9c1e7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 47
      src/Avalonia.Base/Threading/Dispatcher.Invoke.cs

47
src/Avalonia.Base/Threading/Dispatcher.Invoke.cs

@ -1,5 +1,4 @@
using System; using System;
using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -118,11 +117,11 @@ public partial class Dispatcher
} }
/// <summary> /// <summary>
/// Executes the specified Func<TResult> synchronously on the /// Executes the specified Func&lt;TResult&gt; synchronously on the
/// thread that the Dispatcher was created on. /// thread that the Dispatcher was created on.
/// </summary> /// </summary>
/// <param name="callback"> /// <param name="callback">
/// A Func<TResult> delegate to invoke through the dispatcher. /// A Func&lt;TResult&gt; delegate to invoke through the dispatcher.
/// </param> /// </param>
/// <returns> /// <returns>
/// The return value from the delegate being invoked. /// The return value from the delegate being invoked.
@ -136,11 +135,11 @@ public partial class Dispatcher
} }
/// <summary> /// <summary>
/// Executes the specified Func<TResult> synchronously on the /// Executes the specified Func&lt;TResult&gt; synchronously on the
/// thread that the Dispatcher was created on. /// thread that the Dispatcher was created on.
/// </summary> /// </summary>
/// <param name="callback"> /// <param name="callback">
/// A Func<TResult> delegate to invoke through the dispatcher. /// A Func&lt;TResult&gt; delegate to invoke through the dispatcher.
/// </param> /// </param>
/// <param name="priority"> /// <param name="priority">
/// The priority that determines in what order the specified /// The priority that determines in what order the specified
@ -156,11 +155,11 @@ public partial class Dispatcher
} }
/// <summary> /// <summary>
/// Executes the specified Func<TResult> synchronously on the /// Executes the specified Func&lt;TResult&gt; synchronously on the
/// thread that the Dispatcher was created on. /// thread that the Dispatcher was created on.
/// </summary> /// </summary>
/// <param name="callback"> /// <param name="callback">
/// A Func<TResult> delegate to invoke through the dispatcher. /// A Func&lt;TResult&gt; delegate to invoke through the dispatcher.
/// </param> /// </param>
/// <param name="priority"> /// <param name="priority">
/// The priority that determines in what order the specified /// The priority that determines in what order the specified
@ -183,11 +182,11 @@ public partial class Dispatcher
} }
/// <summary> /// <summary>
/// Executes the specified Func<TResult> synchronously on the /// Executes the specified Func&lt;TResult&gt; synchronously on the
/// thread that the Dispatcher was created on. /// thread that the Dispatcher was created on.
/// </summary> /// </summary>
/// <param name="callback"> /// <param name="callback">
/// A Func<TResult> delegate to invoke through the dispatcher. /// A Func&lt;TResult&gt; delegate to invoke through the dispatcher.
/// </param> /// </param>
/// <param name="priority"> /// <param name="priority">
/// The priority that determines in what order the specified /// The priority that determines in what order the specified
@ -317,11 +316,11 @@ public partial class Dispatcher
} }
/// <summary> /// <summary>
/// Executes the specified Func<TResult> asynchronously on the /// Executes the specified Func&lt;TResult&gt; asynchronously on the
/// thread that the Dispatcher was created on. /// thread that the Dispatcher was created on.
/// </summary> /// </summary>
/// <param name="callback"> /// <param name="callback">
/// A Func<TResult> delegate to invoke through the dispatcher. /// A Func&lt;TResult&gt; delegate to invoke through the dispatcher.
/// </param> /// </param>
/// <returns> /// <returns>
/// An operation representing the queued delegate to be invoked. /// An operation representing the queued delegate to be invoked.
@ -335,11 +334,11 @@ public partial class Dispatcher
} }
/// <summary> /// <summary>
/// Executes the specified Func<TResult> asynchronously on the /// Executes the specified Func&lt;TResult&gt; asynchronously on the
/// thread that the Dispatcher was created on. /// thread that the Dispatcher was created on.
/// </summary> /// </summary>
/// <param name="callback"> /// <param name="callback">
/// A Func<TResult> delegate to invoke through the dispatcher. /// A Func&lt;TResult&gt; delegate to invoke through the dispatcher.
/// </param> /// </param>
/// <param name="priority"> /// <param name="priority">
/// The priority that determines in what order the specified /// The priority that determines in what order the specified
@ -355,11 +354,11 @@ public partial class Dispatcher
} }
/// <summary> /// <summary>
/// Executes the specified Func<TResult> asynchronously on the /// Executes the specified Func&lt;TResult&gt; asynchronously on the
/// thread that the Dispatcher was created on. /// thread that the Dispatcher was created on.
/// </summary> /// </summary>
/// <param name="callback"> /// <param name="callback">
/// A Func<TResult> delegate to invoke through the dispatcher. /// A Func&lt;TResult&gt; delegate to invoke through the dispatcher.
/// </param> /// </param>
/// <param name="priority"> /// <param name="priority">
/// The priority that determines in what order the specified /// The priority that determines in what order the specified
@ -479,7 +478,7 @@ public partial class Dispatcher
// operation has already started when the timeout expires, // operation has already started when the timeout expires,
// we still wait for it to complete. This is different // we still wait for it to complete. This is different
// than simply waiting on the operation with a timeout // than simply waiting on the operation with a timeout
// because we are the ones queueing the dispatcher // because we are the ones queuing the dispatcher
// operation, not the caller. We can't leave the operation // operation, not the caller. We can't leave the operation
// in a state that it might execute if we return that it did not // in a state that it might execute if we return that it did not
// invoke. // invoke.
@ -492,12 +491,12 @@ public partial class Dispatcher
// Old async semantics return from Wait without // Old async semantics return from Wait without
// throwing an exception if the operation was aborted. // throwing an exception if the operation was aborted.
// There is no need to test the timout condition, since // There is no need to test the timeout condition, since
// the old async semantics would just return the result, // the old async semantics would just return the result,
// which would be null. // which would be null.
// This should not block because either the operation // This should not block because either the operation
// is using the old async sematics, or the operation // is using the old async semantics, or the operation
// completed successfully. // completed successfully.
result = operation.GetResult(); result = operation.GetResult();
} }
@ -543,11 +542,11 @@ public partial class Dispatcher
} }
/// <summary> /// <summary>
/// Executes the specified Func<Task> asynchronously on the /// Executes the specified Func&lt;Task&gt; asynchronously on the
/// thread that the Dispatcher was created on /// thread that the Dispatcher was created on
/// </summary> /// </summary>
/// <param name="callback"> /// <param name="callback">
/// A Func<Task> delegate to invoke through the dispatcher. /// A Func&lt;Task&gt; delegate to invoke through the dispatcher.
/// </param> /// </param>
/// <param name="priority"> /// <param name="priority">
/// The priority that determines in what order the specified /// The priority that determines in what order the specified
@ -564,11 +563,11 @@ public partial class Dispatcher
} }
/// <summary> /// <summary>
/// Executes the specified Func<Task<TResult>> asynchronously on the /// Executes the specified Func&lt;Task&lt;TResult&gt;&gt; asynchronously on the
/// thread that the Dispatcher was created on /// thread that the Dispatcher was created on
/// </summary> /// </summary>
/// <param name="callback"> /// <param name="action">
/// A Func<Task<TResult>> delegate to invoke through the dispatcher. /// A Func&lt;Task&lt;TResult&gt;&gt; delegate to invoke through the dispatcher.
/// </param> /// </param>
/// <param name="priority"> /// <param name="priority">
/// The priority that determines in what order the specified /// The priority that determines in what order the specified
@ -595,4 +594,4 @@ public partial class Dispatcher
_ = action ?? throw new ArgumentNullException(nameof(action)); _ = action ?? throw new ArgumentNullException(nameof(action));
InvokeAsyncImpl(new SendOrPostCallbackDispatcherOperation(this, priority, action, arg, true), CancellationToken.None); InvokeAsyncImpl(new SendOrPostCallbackDispatcherOperation(this, priority, action, arg, true), CancellationToken.None);
} }
} }

Loading…
Cancel
Save