diff --git a/src/ReC.Client/TaskSyncExtensions.cs b/src/ReC.Client/TaskSyncExtensions.cs index 2effd36..e9edcad 100644 --- a/src/ReC.Client/TaskSyncExtensions.cs +++ b/src/ReC.Client/TaskSyncExtensions.cs @@ -7,12 +7,14 @@ namespace ReC.Client /// /// Provides synchronous wrappers for Task-based operations. /// + [System.Obsolete("Synchronous blocking helpers (Task.Sync) are no longer recommended. These methods can cause deadlocks or unexpected behavior. Rewrite calling code to use async/await (e.g. async Task tests). This helper class will be removed in a future release.", false)] public static class TaskSyncExtensions { /// /// Blocks until the task completes and propagates any exception. /// /// The task to wait for. + [System.Obsolete("Use async/await instead of synchronous blocking. This method can cause deadlocks.", false)] public static void Sync(this Task task) => task.ConfigureAwait(false).GetAwaiter().GetResult(); /// @@ -21,6 +23,7 @@ namespace ReC.Client /// The type of the task result. /// The task to wait for. /// The result of the completed task. + [System.Obsolete("Use async/await instead of synchronous blocking. This method can cause deadlocks.", false)] public static TResult Sync(this Task task) => task.ConfigureAwait(false).GetAwaiter().GetResult(); } } \ No newline at end of file