about summary refs log tree commit diff
path: root/library/std/src/sys/pal
AgeCommit message (Collapse)AuthorLines
2024-01-13std: xous: fix thread_local_key under testsSean Cross-38/+63
When running tests, libstd gets implemented as a second library. Due to this fact, the `create()` and `destroy()` functions come from different libraries. To work around this, stash the `destroy_tls()` pointer in the first unused slot in the thread local storage pool. That way even if the destruction comes from a different version of libstd, the correct `DTORS` list will be consulted. Signed-off-by: Sean Cross <sean@xobs.io>
2024-01-13std: once: use queue implementation on XousSean Cross-2/+0
Use the global queue implementation of Once when running on Xous. This gets us a thread-safe implementation, rather than using the non-threadsafe `unsupported` implementation. Signed-off-by: Sean Cross <sean@xobs.io>
2024-01-13std: xous: rewrite rwlock to be more robustSean Cross-21/+23
Add more checks to RwLock on Xous. As part of this, ensure the variable is in a good state when unlocking. Additionally, use the global `yield_now()` rather than platform-specific `do_yield()`. Signed-off-by: Sean Cross <sean@xobs.io>
2024-01-13std: xous: use blocking_scalars for mutex unlockSean Cross-13/+7
Use blocking scalars when unlocking a mutex. This ensures that mutexes are unlocked immediately rather than dangling. Signed-off-by: Sean Cross <sean@xobs.io>
2024-01-13std: xous: rework condvar to fix soundness issuesSean Cross-61/+98
Rework the Condvar implementation on Xous to ensure notifications are not missed. This involves keeping track of how many times a Condvar timed out and synchronizing based on that. Signed-off-by: Sean Cross <sean@xobs.io>
2024-01-13xous: std: thread_parking: fix deadlocksbunnie-22/+40
Fix a deadlock condition that can occur when a thread is awoken in between the point at which it checks its wake state and the point where it actually waits. This change will cause the waker to continuously send Notify messages until it actually wakes up the target thread. Signed-off-by: Sean Cross <sean@xobs.io>
2024-01-12update paths in commentsjoboet-4/+4
2024-01-11std: fix module references on Windowsjoboet-5/+5
2024-01-11std: fix module references on UNIXjoboet-8/+8
2024-01-11std: fix module references on UEFIjoboet-2/+2
2024-01-11std: fix module reference on SGXjoboet-1/+1
2024-01-11std: fix module references on hermitjoboet-15/+13
2024-01-11std: begin moving platform support modules into `pal`joboet-0/+51856
2023-10-25Convert `Unix{Datagram,Stream}::{set_}passcred()` to per-OS traitsJohn Millikin-10/+16
These methods are the pre-stabilized API for obtaining peer credentials from an `AF_UNIX` socket, part of the `unix_socket_ancillary_data` feature. Their current behavior is to get/set one of the `SO_PASSCRED` (Linux), `LOCAL_CREDS_PERSISTENT` (FreeBSD), or `LOCAL_CREDS` (NetBSD) socket options. On other targets the `{set_}passcred()` methods do not exist. There are two problems with this approach: 1. Having public methods only exist for certain targets isn't permitted in a stable `std` API. 2. These options have generally similar purposes, but they are non-POSIX and their details can differ in subtle and surprising ways (such as whether they continue to be set after the next call to `recvmsg()`). Splitting into OS-specific extension traits is the preferred solution to both problems.