mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 22:18:23 +03:00
Restrict mutex static initializer test to Linux
On macOS, libc does not have a static initializer for recursive mutexes
This commit is contained in:
@@ -10,10 +10,13 @@ fn main() {
|
||||
{
|
||||
test_mutex_libc_init_recursive();
|
||||
test_mutex_libc_init_normal();
|
||||
test_mutex_libc_static_initializer_recursive();
|
||||
test_rwlock_stdlib();
|
||||
test_rwlock_libc_static_initializer();
|
||||
}
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
test_mutex_libc_static_initializer_recursive();
|
||||
}
|
||||
}
|
||||
|
||||
fn test_mutex_stdlib() {
|
||||
@@ -64,7 +67,7 @@ fn test_mutex_libc_init_normal() {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
#[cfg(target_os = "linux")]
|
||||
fn test_mutex_libc_static_initializer_recursive() {
|
||||
let mutex = std::cell::UnsafeCell::new(libc::PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP);
|
||||
unsafe {
|
||||
|
||||
Reference in New Issue
Block a user