]> git.lizzy.rs Git - rust.git/commitdiff
yield on x86 'pause' hint
authorRalf Jung <post@ralfj.de>
Sun, 3 May 2020 10:24:57 +0000 (12:24 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 3 May 2020 10:43:38 +0000 (12:43 +0200)
src/shims/foreign_items.rs

index 9e531accd06a8dae6c8bf9d77f84d6eed35c92d4..25aece5989b922d212f1349c9315ac7b91d3ed30 100644 (file)
@@ -434,7 +434,9 @@ fn emulate_foreign_item_by_name(
             }
 
             // Architecture-specific shims
-            "llvm.x86.sse2.pause" if this.tcx.sess.target.target.arch == "x86" || this.tcx.sess.target.target.arch == "x86_64" => {}
+            "llvm.x86.sse2.pause" if this.tcx.sess.target.target.arch == "x86" || this.tcx.sess.target.target.arch == "x86_64" => {
+                this.sched_yield()?;
+            }
 
             // Platform-specific shims
             _ => match this.tcx.sess.target.target.target_os.as_str() {