diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-07-26 18:56:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-26 18:56:47 +0200 |
| commit | ceea0be207f8a32b71142e9b5d2a4e9befcbe705 (patch) | |
| tree | 2744cf16f88cb9178b855922dedfb775b4083fc0 /src/libstd/sys/vxworks/thread.rs | |
| parent | 5ffdca77c44f3233abe389890ba73e966d90406d (diff) | |
| parent | 279c399599357cdb40d2bbe24a769d2d1dd4a9d9 (diff) | |
| download | rust-ceea0be207f8a32b71142e9b5d2a4e9befcbe705.tar.gz rust-ceea0be207f8a32b71142e9b5d2a4e9befcbe705.zip | |
Rollup merge of #62862 - BaoshanPang:cleanup, r=alexcrichton
code cleanup remove all codes that are not used by vxWorks
Diffstat (limited to 'src/libstd/sys/vxworks/thread.rs')
| -rw-r--r-- | src/libstd/sys/vxworks/thread.rs | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/libstd/sys/vxworks/thread.rs b/src/libstd/sys/vxworks/thread.rs index 810dbad7284..58af8cbe48e 100644 --- a/src/libstd/sys/vxworks/thread.rs +++ b/src/libstd/sys/vxworks/thread.rs @@ -1,4 +1,3 @@ -//use crate::boxed::FnBox; use crate::cmp; use crate::ffi::CStr; use crate::io; @@ -9,10 +8,7 @@ use crate::time::Duration; use crate::sys_common::thread::*; -#[cfg(not(target_os = "l4re"))] pub const DEFAULT_MIN_STACK_SIZE: usize = 2 * 1024 * 1024; -#[cfg(target_os = "l4re")] -pub const DEFAULT_MIN_STACK_SIZE: usize = 1024 * 1024; pub struct Thread { id: libc::pthread_t, @@ -25,18 +21,11 @@ unsafe impl Sync for Thread {} // The pthread_attr_setstacksize symbol doesn't exist in the emscripten libc, // so we have to not link to it to satisfy emcc's ERROR_ON_UNDEFINED_SYMBOLS. -#[cfg(not(target_os = "emscripten"))] unsafe fn pthread_attr_setstacksize(attr: *mut libc::pthread_attr_t, stack_size: libc::size_t) -> libc::c_int { libc::pthread_attr_setstacksize(attr, stack_size) } -#[cfg(target_os = "emscripten")] -unsafe fn pthread_attr_setstacksize(_attr: *mut libc::pthread_attr_t, - _stack_size: libc::size_t) -> libc::c_int { - panic!() -} - impl Thread { // unsafe: see thread::Builder::spawn_unchecked for safety requirements pub unsafe fn new(stack: usize, p: Box<dyn FnOnce()>) @@ -149,31 +138,6 @@ pub mod guard { pub unsafe fn deinit() {} } -// glibc >= 2.15 has a __pthread_get_minstack() function that returns -// PTHREAD_STACK_MIN plus however many bytes are needed for thread-local -// storage. We need that information to avoid blowing up when a small stack -// is created in an application with big thread-local storage requirements. -// See #6233 for rationale and details. -#[cfg(target_os = "linux")] -#[allow(deprecated)] -fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize { - weak!(fn __pthread_get_minstack(*const libc::pthread_attr_t) -> libc::size_t); - - match __pthread_get_minstack.get() { - None => libc::PTHREAD_STACK_MIN, - Some(f) => unsafe { f(attr) }, - } -} - -// No point in looking up __pthread_get_minstack() on non-glibc -// platforms. -#[cfg(all(not(target_os = "linux"), - not(target_os = "netbsd")))] fn min_stack_size(_: *const libc::pthread_attr_t) -> usize { libc::PTHREAD_STACK_MIN } - -#[cfg(target_os = "netbsd")] -fn min_stack_size(_: *const libc::pthread_attr_t) -> usize { - 2048 // just a guess -} |
