Commit Graph

65 Commits

Author SHA1 Message Date
Jeremy Soller 1b6bd3700b Merge branch 'pthread-docs' into 'master'
Document all pthread functions

See merge request redox-os/relibc!1305
2026-05-11 06:15:24 -06:00
Wildan M 58537615bf Document all pthread functions 2026-05-10 14:08:41 +07:00
Wildan M d9e1c69f5b Fix EINVAL at pthread_key_delete 2026-05-10 13:45:04 +07:00
auronandace 05b8ffbcb7 import timespec from time rather than bits 2026-05-03 14:33:39 +01:00
Wildan M d16dfade59 Use less cloning for timespec 2026-05-03 03:21:06 +07:00
auronandace 49f96a96e6 rename bits_time to bits_timespec for consistency 2026-04-09 10:50:04 +01:00
Wildan M f5dd08dc49 Add and fix pthread rwlock timeout tests 2026-03-29 11:31:08 +07:00
Wildan M 928a446f12 Implement clockid_t handling to pthread_rwlock timeout 2026-03-29 10:51:04 +07:00
auronandace 293a2e991d do not derive Copy for timespec 2026-03-11 14:37:16 +00:00
Jeremy Soller af2e4a72c6 Merge branch 'fix-pthread_rwlockattr_setpshared' into 'master'
fix: handle invalid `pshared` in `pthread_rwlockattr_setpshared`

Closes #264

See merge request redox-os/relibc!987
2026-02-24 08:13:30 -07:00
auronandace c879035288 pthread and shadow cleanup 2026-02-23 16:28:26 +00:00
auronandace 0e1af0503e remove export rename from the bits cbindgen file 2026-02-12 13:59:23 +00:00
auronandace 1191d8e1b4 extract timespec to a bits header 2026-02-12 13:07:24 +00:00
Marsman ca84f5b795 fix: handle invalid pshared in pthread_rwlockattr_setpshared 2026-02-10 02:45:24 +00:00
auronandace c3f3e051e1 add unused-unsafe lint 2026-02-08 15:39:48 +00:00
auronandace 473bf0389a start adding some clippy lints to Cargo.toml 2026-02-06 14:53:59 +00:00
auronandace 8d7b86ffb3 remove Copy from RcltAttr 2026-01-29 13:07:54 +00:00
auronandace 17cc166fff widen unsafe block for pthread barrier test 2026-01-28 22:10:48 +00:00
Jeremy Soller dff1e17baa Merge branch 'master' into 'master'
misc(pthread/mutex): cleanup

See merge request redox-os/relibc!918
2026-01-27 09:18:29 -07:00
Anhad Singh 2f8f12e3c7 misc(pthread/mutex): cleanup
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-01-28 01:05:11 +11:00
Jeremy Soller 199d635c84 Merge branch 'master' into 'master'
fix(pthread/mutex): broken `pthread_mutexattr_*`

See merge request redox-os/relibc!917
2026-01-27 04:11:49 -07:00
Anhad Singh d82240f228 fix(pthread/mutex): broken pthread_mutexattr_*
Regression of https://gitlab.redox-os.org/redox-os/relibc/-/merge_requests/890

* The unsafe block needs to be moved *outside* to make sure the `attr`
  is mutated.
* `RlctMutexAttr` was `Copy` which is not required.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-01-27 19:31:14 +11:00
Wildan M f15322453b Convert all println to log or todo 2026-01-25 05:27:38 +07:00
Anhad Singh f3d16d3fbd fix(pthread/tls): nit
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-01-23 14:29:35 +11:00
Anhad Singh 0f4a82b5e8 fix(pthread/tls): destructors
Also added tests for it.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-01-23 14:24:43 +11:00
sourceturner defd2ce7c3 Deny deny-unsafe_op_in_unsafe_fn on the crate level 2026-01-21 00:41:57 +01:00
sourceturner ac449a4338 Use unsafe blocks in pthread.h implementation 2026-01-18 21:09:17 +01:00
Wildan M 9789af36f0 Put timespec convert into common fn 2026-01-07 00:07:50 +07:00
Wildan M ba4d789f6e Calculate pthread_mutex_timedlock clock 2026-01-06 23:33:00 +07:00
Wildan M 242ed32b42 Implement pthread_cond_timedwait futex properly 2026-01-06 15:33:58 +07:00
auronandace d2429a1164 only import the needed types 2025-12-13 21:10:51 +00:00
auronandace 59e028d96d Update and add spec links 2025-12-13 20:56:02 +00:00
Wildan Mubarok d6eaa0dbf9 Fix missing symbols for ARM dynamic linking 2025-12-10 06:16:16 -07:00
4lDO2 512c4f0aa8 Clarification of st_mode bits extraction code. 2025-11-12 12:10:11 +01:00
Jeremy Soller 32b3d2d343 Fix pthread key collision 2025-11-10 15:40:34 -07:00
Jeremy Soller 82084440ad Support nightly-2025-10-03 2025-10-03 21:51:10 -06:00
Jeremy Soller 43b0f235ca Implement pthread_getattr_np 2025-09-30 12:49:22 -06:00
Josh Megnauth 51bc7f7d2c Const init pthread_atfork; export in pthread.h
`pthread_atfork` should be exported in pthread.h according to the
standard. We only exported our function in unistd.h. `glibc` exports it
in both pthread.h and unistd.h whereas musl only exports it in pthread.h
(which is standards compliant).

I exported it in both headers. Cbindgen doesn't seem to reexport `pub
use` so I declared the function twice. We might have to reexamine our
`pub use` to check what's exported and what isn't.
2025-09-01 22:21:15 -04:00
Wildan Mubarok b23ac06a01 Update pthread_attr_getstacksize to fix Go CGO 2025-07-20 17:01:47 +00:00
Anhad Singh cfe89f828a feat: rwlock instead of mutex for global scope
* Rwlock -> InnerRwLock
* RwLock makes use of InnerRwLock.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-31 00:54:52 +11:00
Josh Megnauth 5348273ccc Emit C attributes via cbindgen 2024-11-17 16:15:07 +00:00
4lDO2 4bd0d2a1ef Move pthread::Errno to separate module. 2024-09-11 23:22:29 +02:00
4lDO2 8dc3cca1e6 Allow (nonstandard?) pthread old{ty,state} == NULL 2024-08-10 12:59:20 +02:00
Jeremy Soller 5b78afe5be Do not set constants UNLOCKED and LOCKED 2024-02-02 15:40:41 -07:00
Jeremy Soller 92b56f3f92 Format 2024-01-03 11:46:29 -07:00
Noa df6f4678e8 Fix warnings 2023-05-30 13:46:17 -05:00
4lDO2 cdd0f67b23 Rustfmt. 2023-05-17 15:28:10 +02:00
4lDO2 89429f26c0 Follow POSIX by allowing NULL pthread_key_t dtors. 2023-05-12 18:09:22 +02:00
Jeremy Soller 2941e5b36a Add _POSIX_THREADS definition 2023-05-11 17:18:16 -06:00
Jeremy Soller 66f1f32ac2 Pad RlctAttr for 32-bit systems 2023-05-11 12:06:53 -06:00