diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2016-04-06 21:46:01 -0600 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-04-06 20:46:01 -0700 |
commit | 4abf6102bcaac48e0853e5a30249c6ea1538f4b5 (patch) | |
tree | 37a320ace0c1a416474fe49f2f6fbd9e3c63f78c /Xamarin.Forms.Platform.Android | |
parent | ab0cd64ba5dd3cde58700c50e27c00f812d18d96 (diff) | |
download | xamarin-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.cs | 10 |
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) { |