Commit Graph

1276 Commits

Author SHA1 Message Date
Jeremy Soller 51c93c4b39 Cleanup of wchar_t and wint_t definitions 2023-05-11 10:41:49 -06:00
Jeremy Soller 848fde933b Merge branch 'remove_pthreads_emb' into 'master'
Replace pthreads-emb with a native implementation

See merge request redox-os/relibc!380
2023-05-11 13:56:11 +00:00
Jeremy Soller 29c898dff0 Cargo format 2023-05-11 07:48:51 -06:00
Jeremy Soller e1ecdbd8a5 Implement vfwprintf 2023-05-11 07:48:49 -06:00
Jeremy Soller 5a5bd0c983 Add stubs for wprintf functions 2023-05-11 07:48:21 -06:00
Jeremy Soller 63ea94c439 Merge branch 'sigwait_impl' into 'master'
signal adding sig(timed)wait implementations

See merge request redox-os/relibc!392
2023-05-10 12:49:38 +00:00
Darley Barreto 82eb083091 Fixing wcsrtombs 2023-05-10 12:48:33 +00:00
David Carlier a5cfc5d260 signal adding sig(timed)wait implementations 2023-05-09 20:33:03 +01:00
Jeremy Soller b25bbae2e0 Merge branch 'time__var_impl' into 'master'
clock_getres/clock_settime additions

See merge request redox-os/relibc!389
2023-05-09 14:24:25 +00:00
Darley Barreto c659bf11f9 Implementing ungetwc 2023-05-09 14:23:25 +00:00
David Carlier 2db85f9a3f clock_getres/clock_settime additions 2023-05-08 18:52:05 +01:00
Darley Barreto 7155005be2 Adding wcsrtombs. 2023-05-08 12:39:53 +00:00
4lDO2 4169e99aa5 Stop requiring #![feature(atomic_mut_ptr)]. 2023-05-07 19:20:20 +02:00
4lDO2 a7708a9fc8 Fix AtomicPtr::as_ptr compiler version problem. 2023-05-07 11:17:04 +02:00
Jeremy Soller 26a8e316f1 Merge branch 'rw_van_230506' into 'master'
fix tzset cbindgen declarations

See merge request redox-os/relibc!386
2023-05-06 20:24:35 +00:00
Ron Williams 95e9162d22 change tzname to be mut 2023-05-06 13:20:30 -07: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 d5781306d8 Support custom pthread stacks. 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 b4600182b8 Also add SIGRTMAX. 2023-05-06 17:02:53 +02:00
4lDO2 c92ab239e3 Send RLCT_CANCEL and not SIGTERM when main exits. 2023-05-06 17:02:53 +02:00
4lDO2 79dfddf82c Switch to a boring mutex+condvar based barrier.
While the atomic version might be better, at the moment the priority is
to just to get RLCT working reliably.
2023-05-06 17:02:53 +02:00
4lDO2 4e5596698d Hack to support multiple compiler versions. 2023-05-06 17:02:53 +02:00
4lDO2 a3e1eed100 Wake all when unlocking internal mutexes.
This is because we don't yet count the number of waiting threads,
instead just flagging where or not there are any waiters.
2023-05-06 17:02:53 +02:00
4lDO2 7bcfa9cfd9 Fix Linux. 2023-05-06 17:02:53 +02:00
4lDO2 d1da867919 Make sighold unsafe. 2023-05-06 17:02:53 +02:00
4lDO2 e6df6ccfb3 Fix once and try to improve barrier. 2023-05-06 17:02:53 +02:00
4lDO2 8d9dd0df45 Improve pthread_cleanup_{push,pop}. 2023-05-06 17:02:53 +02:00
4lDO2 714e73112d Simplify Mutex implementation, for now. 2023-05-06 17:02:52 +02:00
4lDO2 fb3242badc New attempt at pthread_cleanup_{push,pop}. 2023-05-06 17:02:52 +02:00
4lDO2 dc8ee7b2f0 Adjust pthread_cond_t size. 2023-05-06 17:02:52 +02:00
4lDO2 beac24828d Use futex directly in waitval. 2023-05-06 17:02:52 +02:00
4lDO2 4faa315591 Use broadcast in Cond, for now. 2023-05-06 17:02:52 +02:00
4lDO2 492be53c2c Remove old pthreads-emb OS-specific code. 2023-05-06 17:02:52 +02:00
4lDO2 1d989d5cb6 Improve barrier.
Maybe it would be better to simply stick to a mutex and condvar, as
libstd does. Optimization is for later anyway.
2023-05-06 17:02:52 +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 38f89cb4bb Improved barrier implementation. 2023-05-06 17:02:51 +02:00
4lDO2 cf34e2512e Move condvar impl to a mostly-safe module. 2023-05-06 17:02:51 +02:00
4lDO2 22ffed707f Fix embarrasing deadlock! 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 f0d8b6fd31 Specify the type in pthread initializers as well.
Otherwise it would be possible to do e.g.

`pthread_mutex_t mutex = PTHREAD_ONCE_INITIALIZER;```,
which would expand to
```pthread_mutex_t mutex = {0};```.
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