83 lines
2.8 KiB
Plaintext
83 lines
2.8 KiB
Plaintext
From e3c6f9e5050f7b44cd6f6ba4b75de1c4be5bd255 Mon Sep 17 00:00:00 2001
|
|
From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
|
|
Date: Sat, 13 Jun 2020 17:17:25 +0000
|
|
Subject: Haiku-specific patches for Rust 1.44.0
|
|
|
|
|
|
diff --git a/Cargo.lock b/Cargo.lock
|
|
index 3456b65..dccbe43 100644
|
|
--- a/Cargo.lock
|
|
+++ b/Cargo.lock
|
|
@@ -4654,9 +4654,9 @@ checksum = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86"
|
|
|
|
[[package]]
|
|
name = "socket2"
|
|
-version = "0.3.12"
|
|
+version = "0.3.11"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
-checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918"
|
|
+checksum = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85"
|
|
dependencies = [
|
|
"cfg-if",
|
|
"libc",
|
|
diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs
|
|
index 895ea48..fb2632e 100644
|
|
--- a/src/libstd/sys/unix/thread.rs
|
|
+++ b/src/libstd/sys/unix/thread.rs
|
|
@@ -190,7 +190,7 @@ impl Thread {
|
|
unsafe {
|
|
let ret = libc::pthread_join(self.id, ptr::null_mut());
|
|
mem::forget(self);
|
|
- assert!(ret == 0, "failed to join thread: {}", io::Error::from_raw_os_error(ret));
|
|
+ debug_assert_eq!(ret, 0);
|
|
}
|
|
}
|
|
|
|
diff --git a/src/libstd/sys/windows/c.rs b/src/libstd/sys/windows/c.rs
|
|
index 134f508..741b673 100644
|
|
--- a/src/libstd/sys/windows/c.rs
|
|
+++ b/src/libstd/sys/windows/c.rs
|
|
@@ -255,7 +255,6 @@ pub const FILE_END: DWORD = 2;
|
|
|
|
pub const WAIT_OBJECT_0: DWORD = 0x00000000;
|
|
pub const WAIT_TIMEOUT: DWORD = 258;
|
|
-pub const WAIT_FAILED: DWORD = 0xFFFFFFFF;
|
|
|
|
pub const PIPE_ACCESS_INBOUND: DWORD = 0x00000001;
|
|
pub const PIPE_ACCESS_OUTBOUND: DWORD = 0x00000002;
|
|
diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs
|
|
index 38839ea..7bb8c95 100644
|
|
--- a/src/libstd/sys/windows/thread.rs
|
|
+++ b/src/libstd/sys/windows/thread.rs
|
|
@@ -70,10 +70,7 @@ impl Thread {
|
|
}
|
|
|
|
pub fn join(self) {
|
|
- let rc = unsafe { c::WaitForSingleObject(self.handle.raw(), c::INFINITE) };
|
|
- if rc == c::WAIT_FAILED {
|
|
- panic!("failed to join on thread: {}", io::Error::last_os_error());
|
|
- }
|
|
+ unsafe { c::WaitForSingleObject(self.handle.raw(), c::INFINITE); }
|
|
}
|
|
|
|
pub fn yield_now() {
|
|
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
|
|
index 282e268..fc30616 100644
|
|
--- a/src/libstd/thread/mod.rs
|
|
+++ b/src/libstd/thread/mod.rs
|
|
@@ -1465,11 +1465,6 @@ impl<T> JoinHandle<T> {
|
|
/// [`panic`]: ../../std/macro.panic.html
|
|
/// [atomic memory orderings]: ../../std/sync/atomic/index.html
|
|
///
|
|
- /// # Panics
|
|
- ///
|
|
- /// This function may panic on some platforms if a thread attempts to join
|
|
- /// itself or otherwise may create a deadlock with joining threads.
|
|
- ///
|
|
/// # Examples
|
|
///
|
|
/// ```
|
|
--
|
|
2.26.0
|
|
|