summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2016-04-06 21:46:01 -0600
committerJason Smith <jason.smith@xamarin.com>2016-04-06 20:46:01 -0700
commit4abf6102bcaac48e0853e5a30249c6ea1538f4b5 (patch)
tree37a320ace0c1a416474fe49f2f6fbd9e3c63f78c /Xamarin.Forms.Platform.Android
parentab0cd64ba5dd3cde58700c50e27c00f812d18d96 (diff)
downloadxamarin-forms-4abf6102bcaac48e0853e5a30249c6ea1538f4b5.tar.gz
xamarin-forms-4abf6102bcaac48e0853e5a30249c6ea1538f4b5.tar.bz2
xamarin-forms-4abf6102bcaac48e0853e5a30249c6ea1538f4b5.zip
Fix race condition in IsInvokeRequired on Android
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/Forms.cs10
1 files changed, 1 insertions, 9 deletions
diff --git a/Xamarin.Forms.Platform.Android/Forms.cs b/Xamarin.Forms.Platform.Android/Forms.cs
index b2ded248..65bfbc4d 100644
--- a/Xamarin.Forms.Platform.Android/Forms.cs
+++ b/Xamarin.Forms.Platform.Android/Forms.cs
@@ -362,15 +362,7 @@ namespace Xamarin.Forms
return new _IsolatedStorageFile(IsolatedStorageFile.GetUserStoreForApplication());
}
- public bool IsInvokeRequired
- {
- get
- {
- using (Looper my = Looper.MyLooper())
- using (Looper main = Looper.MainLooper)
- return my != main;
- }
- }
+ public bool IsInvokeRequired => !Looper.MainLooper.IsCurrentThread;
public void OpenUriAction(Uri uri)
{