Skip to content

Commit 19b01bd

Browse files
committed
Fix 98SE: fix SignalObjectAndWait check
This function is half-available on 98SE (but doesn't exist on 95). According to MSDN it is only supposed to be available on NT4 and up, so adding an NT check. That's what I get for not testing every single version every time :)
1 parent 757dffe commit 19b01bd

File tree

1 file changed

+3
-3
lines changed
  • library/std/src/sys/sync/condvar/rust9x

1 file changed

+3
-3
lines changed

library/std/src/sys/sync/condvar/rust9x/legacy.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::os::windows::io::{AsRawHandle, FromRawHandle, OwnedHandle};
22
use crate::pin::Pin;
33
use crate::sys::c;
4-
use crate::sys::compat::checks::{MutexKind, mutex_kind};
4+
use crate::sys::compat::checks::{MutexKind, is_windows_nt, mutex_kind};
55
use crate::sys::pal::{cvt, dur2timeout};
66
use crate::sys::sync::{Mutex, OnceBox};
77
use crate::time::Duration;
@@ -45,7 +45,7 @@ impl Condvar {
4545
#[inline]
4646
pub unsafe fn wait(&self, mutex: &Mutex) {
4747
let event = self.inner.get_or_init(Self::init);
48-
let use_signal_object_and_wait = if mutex_kind() == MutexKind::Legacy {
48+
let use_signal_object_and_wait = if mutex_kind() == MutexKind::Legacy && is_windows_nt() {
4949
c::SignalObjectAndWait::available()
5050
} else {
5151
None
@@ -76,7 +76,7 @@ impl Condvar {
7676

7777
pub unsafe fn wait_timeout(&self, mutex: &Mutex, dur: Duration) -> bool {
7878
let event = self.inner.get_or_init(Self::init);
79-
let use_signal_object_and_wait = if mutex_kind() == MutexKind::Legacy {
79+
let use_signal_object_and_wait = if mutex_kind() == MutexKind::Legacy && is_windows_nt() {
8080
c::SignalObjectAndWait::available()
8181
} else {
8282
None

0 commit comments

Comments
 (0)