Fix android_runtime_lock not being cfg guarded (#5244)
The `android_runtime_lock` wasn't properly `cfg` guarded in various places, so it got included on all operating systems, not just Android by accident. This causes deadlocks when trying to use `muda`.
This commit is contained in:
1 parent
d01a820b6f
commit
409d8358b6
3 files changed
+6
-2
No files matched your search
@@ -78,6 +78,7 @@ impl WebviewEdits {
|
||||
let response = match serde_json::from_slice(&data_from_header) {
|
||||
Ok(event) => {
|
||||
// we need to wait for the mutex lock to let us munge the main thread..
|
||||
#[cfg(target_os = "android")]
|
||||
let _lock = crate::android_sync_lock::android_runtime_lock();
|
||||
self.handle_html_event(event)
|
||||
}
|
||||
@@ -557,6 +558,7 @@ impl WebviewInstance {
|
||||
|
||||
{
|
||||
// lock the hack-ed in lock sync wry has some thread-safety issues with event handlers and async tasks
|
||||
#[cfg(target_os = "android")]
|
||||
let _lock = crate::android_sync_lock::android_runtime_lock();
|
||||
let fut = self.dom.wait_for_work();
|
||||
pin_mut!(fut);
|
||||
@@ -568,6 +570,7 @@ impl WebviewInstance {
|
||||
}
|
||||
|
||||
// lock the hack-ed in lock sync wry has some thread-safety issues with event handlers
|
||||
#[cfg(target_os = "android")]
|
||||
let _lock = crate::android_sync_lock::android_runtime_lock();
|
||||
|
||||
self.edits
|
||||
|
||||
Reference in new issue
Block a user