-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #121177 - joboet:move_pal_locks, r=ChrisDenton
Move locks to `sys` Part of #117276. r? `@ChrisDenton`
- Loading branch information
Showing
50 changed files
with
144 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...d/src/sys/pal/unix/locks/futex_condvar.rs → library/std/src/sys/locks/condvar/futex.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
library/std/src/sys/pal/itron/condvar.rs → library/std/src/sys/locks/condvar/itron.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
cfg_if::cfg_if! { | ||
if #[cfg(any( | ||
target_os = "linux", | ||
target_os = "android", | ||
target_os = "freebsd", | ||
target_os = "openbsd", | ||
target_os = "dragonfly", | ||
target_os = "fuchsia", | ||
all(target_family = "wasm", target_feature = "atomics"), | ||
target_os = "hermit", | ||
))] { | ||
mod futex; | ||
pub use futex::Condvar; | ||
} else if #[cfg(target_family = "unix")] { | ||
mod pthread; | ||
pub use pthread::Condvar; | ||
} else if #[cfg(target_os = "windows")] { | ||
mod windows; | ||
pub use windows::Condvar; | ||
} else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] { | ||
mod sgx; | ||
pub use sgx::Condvar; | ||
} else if #[cfg(target_os = "solid_asp3")] { | ||
mod itron; | ||
pub use itron::Condvar; | ||
} else if #[cfg(target_os = "teeos")] { | ||
mod teeos; | ||
pub use teeos::Condvar; | ||
} else if #[cfg(target_os = "xous")] { | ||
mod xous; | ||
pub use xous::Condvar; | ||
} else { | ||
mod no_threads; | ||
pub use no_threads::Condvar; | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
library/std/src/sys/pal/sgx/condvar.rs → library/std/src/sys/locks/condvar/sgx.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ary/std/src/sys/pal/xous/locks/condvar.rs → library/std/src/sys/locks/condvar/xous.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
.../std/src/sys/pal/unsupported/locks/mod.rs → library/std/src/sys/locks/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
mod condvar; | ||
mod mutex; | ||
mod rwlock; | ||
|
||
pub use condvar::Condvar; | ||
pub use mutex::Mutex; | ||
pub use rwlock::RwLock; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
cfg_if::cfg_if! { | ||
if #[cfg(any( | ||
target_os = "linux", | ||
target_os = "android", | ||
target_os = "freebsd", | ||
target_os = "openbsd", | ||
target_os = "dragonfly", | ||
all(target_family = "wasm", target_feature = "atomics"), | ||
target_os = "hermit", | ||
))] { | ||
mod futex; | ||
pub use futex::Mutex; | ||
} else if #[cfg(target_os = "fuchsia")] { | ||
mod fuchsia; | ||
pub use fuchsia::Mutex; | ||
} else if #[cfg(any( | ||
target_family = "unix", | ||
target_os = "teeos", | ||
))] { | ||
mod pthread; | ||
pub use pthread::{Mutex, raw}; | ||
} else if #[cfg(target_os = "windows")] { | ||
mod windows; | ||
pub use windows::{Mutex, raw}; | ||
} else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] { | ||
mod sgx; | ||
pub use sgx::Mutex; | ||
} else if #[cfg(target_os = "solid_asp3")] { | ||
mod itron; | ||
pub use itron::Mutex; | ||
} else if #[cfg(target_os = "xous")] { | ||
mod xous; | ||
pub use xous::Mutex; | ||
} else { | ||
mod no_threads; | ||
pub use no_threads::Mutex; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
library/std/src/sys/pal/sgx/mutex.rs → library/std/src/sys/locks/mutex/sgx.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
cfg_if::cfg_if! { | ||
if #[cfg(any( | ||
target_os = "linux", | ||
target_os = "android", | ||
target_os = "freebsd", | ||
target_os = "openbsd", | ||
target_os = "dragonfly", | ||
target_os = "fuchsia", | ||
all(target_family = "wasm", target_feature = "atomics"), | ||
target_os = "hermit", | ||
))] { | ||
mod futex; | ||
pub use futex::RwLock; | ||
} else if #[cfg(target_family = "unix")] { | ||
mod queue; | ||
pub use queue::RwLock; | ||
} else if #[cfg(target_os = "windows")] { | ||
mod windows; | ||
pub use windows::RwLock; | ||
} else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] { | ||
mod sgx; | ||
pub use sgx::RwLock; | ||
} else if #[cfg(target_os = "solid_asp3")] { | ||
mod solid; | ||
pub use solid::RwLock; | ||
} else if #[cfg(target_os = "teeos")] { | ||
mod teeos; | ||
pub use teeos::RwLock; | ||
} else if #[cfg(target_os = "xous")] { | ||
mod xous; | ||
pub use xous::RwLock; | ||
} else { | ||
mod no_threads; | ||
pub use no_threads::RwLock; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions
7
library/std/src/sys/pal/sgx/rwlock.rs → library/std/src/sys/locks/rwlock/sgx.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
library/std/src/sys/pal/solid/rwlock.rs → library/std/src/sys/locks/rwlock/solid.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ mod pal; | |
mod personality; | ||
|
||
pub mod cmath; | ||
pub mod locks; | ||
pub mod os_str; | ||
pub mod path; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.