Skip to content

Commit bb06a0c

Browse files
committed
Restrict mutex static initializer test to Linux
On macOS, libc does not have a static initializer for recursive mutexes
1 parent 7f6df15 commit bb06a0c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/run-pass/sync.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ fn main() {
1010
{
1111
test_mutex_libc_init_recursive();
1212
test_mutex_libc_init_normal();
13-
test_mutex_libc_static_initializer_recursive();
1413
test_rwlock_stdlib();
1514
test_rwlock_libc_static_initializer();
1615
}
16+
#[cfg(target_os = "linux")]
17+
{
18+
test_mutex_libc_static_initializer_recursive();
19+
}
1720
}
1821

1922
fn test_mutex_stdlib() {
@@ -64,7 +67,7 @@ fn test_mutex_libc_init_normal() {
6467
}
6568
}
6669

67-
#[cfg(not(target_os = "windows"))]
70+
#[cfg(target_os = "linux")]
6871
fn test_mutex_libc_static_initializer_recursive() {
6972
let mutex = std::cell::UnsafeCell::new(libc::PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP);
7073
unsafe {

0 commit comments

Comments
 (0)