Skip to content

Commit 6029abb

Browse files
committed
emscripten: Move emscripten-specific pthread bits to the new module
1 parent af044aa commit 6029abb

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

src/new/common/posix/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
//! These can be found at: <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/contents.html>.
44
55
// FIXME(pthread): eventually all platforms should use this module
6-
#[cfg(any(target_os = "android", target_os = "linux"))]
6+
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "linux"))]
77
pub(crate) mod pthread;
88
pub(crate) mod unistd;

src/new/common/posix/pthread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ extern "C" {
9494
pshared: *mut c_int,
9595
) -> c_int;
9696

97-
#[cfg(any(target_os = "android", target_os = "linux"))]
97+
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "linux"))]
9898
pub fn pthread_create(
9999
native: *mut crate::pthread_t,
100100
attr: *const crate::pthread_attr_t,

src/new/emscripten/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
//!
33
//! * Headers: <https://github.com/emscripten-core/emscripten/tree/main/system/lib/libc>
44
5+
pub(crate) mod pthread;
56
pub(crate) mod unistd;

src/new/emscripten/pthread.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//! Header: `pthread.h`
2+
3+
pub use crate::new::common::posix::pthread::pthread_create;

src/new/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ cfg_if! {
207207
cfg_if! {
208208
if #[cfg(target_family = "unix")] {
209209
// FIXME(pthread): eventually all platforms should use this module
210-
#[cfg(any(target_os = "android", target_os = "linux"))]
210+
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "linux"))]
211211
pub use pthread::*;
212212
pub use unistd::*;
213213
}

src/unix/linux_like/emscripten/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,12 +1436,6 @@ extern "C" {
14361436
pub fn ioctl(fd: c_int, request: c_int, ...) -> c_int;
14371437
pub fn getpriority(which: c_int, who: crate::id_t) -> c_int;
14381438
pub fn setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int;
1439-
pub fn pthread_create(
1440-
native: *mut crate::pthread_t,
1441-
attr: *const crate::pthread_attr_t,
1442-
f: extern "C" fn(*mut c_void) -> *mut c_void,
1443-
value: *mut c_void,
1444-
) -> c_int;
14451439

14461440
pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int;
14471441

0 commit comments

Comments
 (0)