summary refs log tree commit diff
path: root/library/std/src/sys/unix/thread.rs
AgeCommit message (Collapse)AuthorLines
2021-07-10Change `weak!` and `linkat!` to macros 2.0Aris Merchant-0/+2
`weak!` is needed in a test in another module. With macros 1.0, importing `weak!` would require reordering module declarations in `std/src/lib.rs`, which is a bit too evil.
2021-06-21Use `Unsupported` on platforms where `available_concurrency` is not implemented.Christiaan Dirkx-1/+1
2021-06-21Move `available_concurrency` implementation to `sys`Christiaan Dirkx-0/+83
2021-04-01Fix stack overflow detection on FreeBSD 11.1+Alan Somers-7/+16
Beginning with FreeBSD 10.4 and 11.1, there is one guard page by default. And the stack autoresizes, so if Rust allocates its own guard page, then FreeBSD's will simply move up one page. The best solution is to just use the OS's guard page.
2021-03-17Display error details when a `mmap` call failsYuki Okushi-2/+3
2021-02-27Remove the x86_64-rumprun-netbsd targetSimonas Kazlauskas-2/+2
Closes #81514
2020-11-12Auto merge of #78965 - jryans:emscripten-threads-libc, r=kennytmbors-19/+1
Update thread and futex APIs to work with Emscripten This updates the thread and futex APIs in `std` to match the APIs exposed by Emscripten. This allows threads to run on `wasm32-unknown-emscripten` and the thread parker to compile without errors related to the missing `futex` module. To make use of this, Rust code must be compiled with `-C target-feature=atomics` and Emscripten must link with `-pthread`. I have confirmed this works well locally when building multithreaded crates. Attempting to enable `std` thread tests currently fails for seemingly obscure reasons and Emscripten is currently disabled in CI, so further work is needed to have proper test coverage here.
2020-11-12Update thread and futex APIs to work with EmscriptenJ. Ryan Stinnett-19/+1
This updates the thread and futex APIs in `std` to match the APIs exposed by Emscripten. This allows threads to run on `wasm32-unknown-emscripten` and the thread parker to compile without errors related to the missing `futex` module. To make use of this, Rust code must be compiled with `-C target-feature=atomics` and Emscripten must link with `-pthread`. I have confirmed this works well locally when building multithreaded crates. Attempting to enable `std` thread tests currently fails for seemingly obscure reasons and Emscripten is currently disabled in CI, so further work is needed to have proper test coverage here.
2020-10-31fix aliasing issue in unix sleep functionRalf Jung-1/+2
2020-10-16Take sys/vxworks/thread from sys/unix instead.Mara Bos-3/+6
2020-09-09Only call pthread_attr_destroy() after getattr_np() succeeds on all libcsTavian Barnes-2/+4
The calling convention of pthread_getattr_np() is to initialize the pthread_attr_t, so _destroy() is only necessary on success (and _init() isn't necessary beforehand). On the other hand, FreeBSD wants the attr_t to be initialized before pthread_attr_get_np(), and therefore it should always be destroyed afterwards.
2020-09-09Fix segfault if pthread_getattr_np failsTavian Barnes-2/+6
glibc destroys[1] the passed pthread_attr_t if pthread_getattr_np() fails. Destroying it again leads to a segfault. Fix it by only destroying it on success for glibc. [1]: https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_getattr_np.c;h=ce437205e41dc05653e435f6188768cccdd91c99;hb=HEAD#l205
2020-08-19Enable stack-overflow detection on musl for non-main threadsTomasz Miąsko-6/+21
2020-07-27mv std libs to library/mark-0/+465