From 61a86e1ffea5bbda721ab2d2702807f085e2a3a4 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 4 May 2020 09:37:40 +0200 Subject: [PATCH 1/3] Windows lock primitives: check that we are truly sinle-threaded --- src/shims/foreign_items/windows.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shims/foreign_items/windows.rs b/src/shims/foreign_items/windows.rs index a58444b21bf..f55b5b8450e 100644 --- a/src/shims/foreign_items/windows.rs +++ b/src/shims/foreign_items/windows.rs @@ -236,12 +236,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx | "LeaveCriticalSection" | "DeleteCriticalSection" if this.frame().instance.to_string().starts_with("std::sys::windows::") => { + assert_eq!(this.get_total_thread_count()?, 1, "concurrency on Windows not supported"); // Nothing to do, not even a return value. // (Windows locks are reentrant, and we have only 1 thread, // so not doing any futher checks here is at least not incorrect.) } "TryEnterCriticalSection" if this.frame().instance.to_string().starts_with("std::sys::windows::") => { + assert_eq!(this.get_total_thread_count()?, 1, "concurrency on Windows not supported"); // There is only one thread, so this always succeeds and returns TRUE this.write_scalar(Scalar::from_i32(1), dest)?; } From 65c3914a29b250081b4dd659657d612929fdaef2 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 4 May 2020 09:43:09 +0200 Subject: [PATCH 2/3] rustup --- rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-version b/rust-version index 81fe678f117..be7b603f905 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -0a675c5e02e6ecfda7d4e04aabd23a9935e0c4bf +ff4df04799c406c8149a041c3163321758aac924 From ec95ed4556e63e93fb5abb453bfb9db41c4c5a76 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 4 May 2020 09:45:15 +0200 Subject: [PATCH 3/3] rename single-threaded sync test --- tests/run-pass/{sync.rs => sync_singlethread.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/run-pass/{sync.rs => sync_singlethread.rs} (100%) diff --git a/tests/run-pass/sync.rs b/tests/run-pass/sync_singlethread.rs similarity index 100% rename from tests/run-pass/sync.rs rename to tests/run-pass/sync_singlethread.rs