summary refs log tree commit diff
path: root/library/std/src/sys/unix/thread.rs
AgeCommit message (Collapse)AuthorLines
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