Commit Graph

42 Commits

Author SHA1 Message Date
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
4lDO2 90a789368e Add missing pthread_barrierattr_destroy. 2023-05-06 17:02:54 +02:00
4lDO2 439b054486 Rustify pthread_rwlock_t. 2023-05-06 17:02:54 +02:00
4lDO2 f60461cbf7 Use drop_in_place for pthread_attr_destroy. 2023-05-06 17:02:53 +02:00
4lDO2 8d9dd0df45 Improve pthread_cleanup_{push,pop}. 2023-05-06 17:02:53 +02:00
4lDO2 4353ef33cd Fix pthread_join by not writing if retval == NULL. 2023-05-06 17:02:52 +02:00
4lDO2 14bfd2efd7 Redefine PTHREAD_BARRIER_SERIAL_THREAD. 2023-05-06 17:02:52 +02:00
4lDO2 9356098fb2 WIP: More complete pthread mutex implementation. 2023-05-06 17:02:52 +02:00
4lDO2 cf34e2512e Move condvar impl to a mostly-safe module. 2023-05-06 17:02:51 +02:00
4lDO2 b455e2e374 Misc improvements, move barrier to safe module. 2023-05-06 17:02:51 +02:00
4lDO2 316203102a Implement pthread_cleanup_{push,pop}. 2023-05-06 17:02:51 +02:00
4lDO2 bd6cc20a75 Make pthread types opaque, and check against libc. 2023-05-06 17:02:51 +02:00
4lDO2 b9f19f4326 Get pcid to work using this pthread impl. 2023-05-06 17:02:51 +02:00
4lDO2 6a658bc33d Add needed functions for acid to link. 2023-05-06 17:02:51 +02:00
4lDO2 2593101ea7 Get it to compile 2023-05-06 17:02:50 +02:00
4lDO2 558d43082c WIP: Expand native pthreads implementation. 2023-05-06 17:02:50 +02:00