Skip to content

Commit 7cae0db

Browse files
David EllingsworthDavid Ellingsworth
authored andcommitted
Revert "Add missing ConfigureAwait on awaited task."
The anonymous method in the RunSync call does not capture the current context until it is executed. Because it is called from within the CustomSynchronizationContext, it will always capture the CustomSynchhronizationContext and not the caller's context. This reverts commit ec15969.
1 parent 66911f9 commit 7cae0db

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/RestSharp/AsyncHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static void RunSync(Func<Task> task) {
3838
/// <returns>Return value from the task</returns>
3939
public static T RunSync<T>(Func<Task<T>> task) {
4040
T result = default!;
41-
RunSync(async () => { result = await task().ConfigureAwait(false); });
41+
RunSync(async () => { result = await task(); });
4242
return result;
4343
}
4444

0 commit comments

Comments
 (0)