summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/wcscspn.c
diff options
context:
space:
mode:
authordlg <>2025-07-12 23:59:44 +0000
committerdlg <>2025-07-12 23:59:44 +0000
commit8082d2222ff57c8446f00bdd20755af6c4f93747 (patch)
tree32c204acfdb9e0e6ebf5b8e75fbee0e3d49e2228 /src/lib/libc/string/wcscspn.c
parent8fef6d309283073d27442541f73fdf94afe6cd44 (diff)
downloadopenbsd-8082d2222ff57c8446f00bdd20755af6c4f93747.tar.gz
openbsd-8082d2222ff57c8446f00bdd20755af6c4f93747.tar.bz2
openbsd-8082d2222ff57c8446f00bdd20755af6c4f93747.zip
add libc specific __cmtx and __rcmtx locks for internal use.
__cmtx provides mutual exclusion using futex(2) and cas on archs that support it, or _spinlocks on the rest. __rcmtx is a recursive mutex built on top of __cmtx, so it inherits the use of futex and cas/spinlock from __cmtx. until now the options we had for locking between threads in libc were spinlocks or pthread mutexes. spinlocks use sched_yield to relax if they have to spin on a contended lock, which we are trying to minimise the use of as much as possible. pthread_mutex is relatively large in memory and offers a lot of complicated features which are unecessary for most of libc. the non cas/futex version of pthread_mutexes currently relies on __thrsleep and __thrwakeup, which we also want to deprecate. having a small futex based lock available everywhere will help us move away from overuse of spinlocks, and deprecate __thrsleep and __thrwakeup. ok kettenis@ jca@ provided his eyes too.
Diffstat (limited to 'src/lib/libc/string/wcscspn.c')
0 files changed, 0 insertions, 0 deletions