Commit Graph

1854 Commits

Author SHA1 Message Date
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
4lDO2 5b56d6305d Remove pthreads-emb, add custom sched.h 2023-05-06 17:02:50 +02:00
Jeremy Soller e09e2eb287 Merge branch 'fix_mspace_bug' into 'master'
Fix mspaces not being protected by locks.

See merge request redox-os/relibc!387
2023-05-06 13:15:56 +00:00
4lDO2 b5a620e5f1 Fix mspaces not being protected by locks. 2023-05-06 14:42:33 +02:00
Jeremy Soller 4c7d1a567b Merge branch 'termios_cfsetspeed_shortcut' into 'master'
termios adding cfsetspeed bsd extension which set both __c_ispeed/__c_ospeed fields

See merge request redox-os/relibc!385
2023-05-05 19:45:10 +00:00
David Carlier c2b00e8c6b termios adding cfsetspeed bsd extension which set both __c_ispeed/__c_ospeed fields 2023-05-05 16:56:23 +01:00
Jeremy Soller 6d6e068beb Merge branch 'rw_van_230504' into 'master'
Fix platform::errno = ... in signal.rs

See merge request redox-os/relibc!384
2023-05-05 15:30:49 +00:00
Ron Williams c105548036 Fix platform::errno = ... in signal.rs 2023-05-04 19:29:12 -07:00
Jeremy Soller 5980327865 Merge branch 'signal_impl2' into 'master'
signal add fewer more implementations

See merge request redox-os/relibc!378
2023-05-04 21:39:13 +00:00
Jeremy Soller 68b2859892 Merge branch 'setsid__impl' into 'master'
setsid implementation

See merge request redox-os/relibc!381
2023-05-04 21:38:40 +00:00
Jeremy Soller 8cba3451fd Merge branch 'cfmakeraw__impl' into 'master'
cfmakeraw implementation proposal

See merge request redox-os/relibc!382
2023-05-04 21:38:03 +00:00
Jeremy Soller 26f55b3019 Merge branch 'gitoxide-port' into 'master'
Add no-op tzset, plus required static vars

See merge request redox-os/relibc!383
2023-05-04 21:37:33 +00:00
Ron Williams efeca2f909 Add no-op tzset, plus required static vars 2023-05-04 13:12:04 -07:00
David Carlier c88279f204 cfmakeraw implementation proposal 2023-05-04 20:18:14 +01:00
David Carlier 5041df0015 setsid implementation 2023-05-04 19:09:32 +01:00
David Carlier 07cc3614c2 signal add fewer more implementations 2023-04-29 09:01:25 +01:00
Jeremy Soller bf7cdc4413 Merge branch 'no_mangle_fixes' into 'master'
fix no_mangle annotation missing

See merge request redox-os/relibc!377
2023-04-26 18:49:07 +00:00
David Carlier eb87e2b796 fix no_mangle annotation missing 2023-04-26 19:42:29 +01:00
Jeremy Soller 30996e353b Merge branch 'signal_various_impl' into 'master'
signal add few missing implementations

See merge request redox-os/relibc!376
2023-04-26 18:28:21 +00:00
Jeremy Soller 8a002ecc1d Merge branch 'sync_impl' into 'master'
sync implementation

See merge request redox-os/relibc!375
2023-04-26 18:24:48 +00:00
Jeremy Soller 0a652622ae Merge branch 'fdatasync_impl' into 'master'
unistd: fdatasync implementation.

See merge request redox-os/relibc!373
2023-04-26 18:22:57 +00:00
David Carlier c44fda84c4 signal add few missing implementations 2023-04-25 22:16:59 +01:00
David Carlier a561e682a3 sync implementation 2023-04-22 13:20:18 +01:00