diff --git a/src/Postmark.PCL/TaskExtensions.cs b/src/Postmark.PCL/TaskExtensions.cs index 71aa7ce..75ebbc9 100644 --- a/src/Postmark.PCL/TaskExtensions.cs +++ b/src/Postmark.PCL/TaskExtensions.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; namespace PostmarkDotNet { @@ -8,10 +9,21 @@ public static class TaskExtensions /// /// Escape async/await by runing the task synchronously, /// will block the current thread until the task completes. + /// + /// DO NOT USE THIS IN A UI THREAD. + /// It will cause your application to become deadlocked. + /// /// + /// + /// You should avoid using this method in new code. If you're unable to use async/await support, + /// consider using "ContinueWith()" + /// in order to ensure proper sequencing operations. + /// /// /// /// + [Obsolete("This convenience method has been deprecated" + + " because it is known cause issues in specific use cases.")] public static T WaitForResult(this Task task) { task.Wait();