diff options
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs index dc5f347be2..ee5ab67e85 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs @@ -424,7 +424,8 @@ namespace MonoDevelop.Core /// </summary> public static void AssertMainThread () { - if (SynchronizationContext.Current != MainSynchronizationContext) + // Compare types, because instances can change (using SynchronizationContext.CreateCopy). + if (SynchronizationContext.Current.GetType () != MainSynchronizationContext.GetType ()) throw new InvalidOperationException ("Operation not supported in background thread"); } |