]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
- Add an api for doing smp safe locks in userland.
authorJeff Roberson <jeff@FreeBSD.org>
Tue, 1 Apr 2003 01:10:42 +0000 (01:10 +0000)
committerJeff Roberson <jeff@FreeBSD.org>
Tue, 1 Apr 2003 01:10:42 +0000 (01:10 +0000)
commit69404b50906a64014f506445bcc3ce0c44364830
tree29698b967989fc4cadf8c3fa0ed39584863c8544
parent90e38817b7ef69ca5764a74e58f910c6795012a7
 - Add an api for doing smp safe locks in userland.
 - umtx_lock() is defined as an inline in umtx.h.  It tries to do an
   uncontested acquire of a lock which falls back to the _umtx_lock()
   system-call if that fails.
 - umtx_unlock() is also an inline which falls back to _umtx_unlock() if the
   uncontested unlock fails.
 - Locks are keyed off of the thr_id_t of the currently running thread which
   is currently just the pointer to the 'struct thread' in kernel.
 - _umtx_lock() uses the proc pointer to synchronize access to blocked thread
   queues which are stored in the first blocked thread.
sys/kern/kern_umtx.c [new file with mode: 0644]
sys/sys/umtx.h [new file with mode: 0644]