about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMohsen Zohrevandi <mohsen.zohrevandi@fortanix.com>2020-07-21 11:08:37 -0700
committerMohsen Zohrevandi <mohsen.zohrevandi@fortanix.com>2020-07-21 11:08:37 -0700
commit141adeb4933bf3ffe1d4a69f51f6055765fdae86 (patch)
treeeb69a32a4fec928098d5ca5c347320836afd6009
parent8ad7bc3f428300aee6764f6e23527e19eb235e81 (diff)
downloadrust-141adeb4933bf3ffe1d4a69f51f6055765fdae86.tar.gz
rust-141adeb4933bf3ffe1d4a69f51f6055765fdae86.zip
Fix sync_once_cell_does_not_leak_partially_constructed_boxes
Spinning multiple threads in this test causes a deadlock in
SGX where thread scheduling is not preemptive.
-rw-r--r--src/libstd/lazy.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/lazy.rs b/src/libstd/lazy.rs
index 86e1cfae582..1705a4f77c5 100644
--- a/src/libstd/lazy.rs
+++ b/src/libstd/lazy.rs
@@ -827,6 +827,8 @@ mod tests {
                         tx.send(msg).unwrap();
                         break;
                     }
+                    #[cfg(target_env = "sgx")]
+                    crate::thread::yield_now();
                 }
             });
         }