freebsd-dev/lib/libc/include
David Xu 9b0f1823b5 Use umtx to implement process sharable semaphore, to make this work,
now type sema_t is a structure which can be put in a shared memory area,
and multiple processes can operate it concurrently.
User can either use mmap(MAP_SHARED) + sem_init(pshared=1) or use sem_open()
to initialize a shared semaphore.
Named semaphore uses file system and is located in /tmp directory, and its
file name is prefixed with 'SEMD', so now it is chroot or jail friendly.
In simplist cases, both for named and un-named semaphore, userland code
does not have to enter kernel to reduce/increase semaphore's count.
The semaphore is designed to be crash-safe, it means even if an application
is crashed in the middle of operating semaphore, the semaphore state is
still safely recovered by later use, there is no waiter counter maintained
by userland code.
The main semaphore code is in libc and libthr only has some necessary stubs,
this makes it possible that a non-threaded application can use semaphore
without linking to thread library.
Old semaphore implementation is kept libc to maintain binary compatibility.
The kernel ksem API is no longer used in the new implemenation.

Discussed on: threads@
2010-01-05 02:37:59 +00:00
..
isc Merge the resolver part of BIND 9.4.3 into HEAD. 2008-12-14 19:39:53 +00:00
compat.h Change the ABI of some of the structures used by the SYSV IPC API: 2009-06-24 21:10:52 +00:00
fpmath.h Add support for the FPA floating-point format on ARM. The 2008-12-23 22:20:59 +00:00
libc_private.h Use umtx to implement process sharable semaphore, to make this work, 2010-01-05 02:37:59 +00:00
namespace.h Make openat(2) a cancellation point. 2009-10-11 20:19:45 +00:00
nscache.h
nscachedcli.h
nss_tls.h Revert unnecessary memset after calloc. 2009-05-28 15:02:21 +00:00
port_after.h
port_before.h
reentrant.h
resolv_mt.h
spinlock.h Remove 3rd clause, renumber, ok per email 2007-01-12 07:31:30 +00:00
un-namespace.h Make openat(2) a cancellation point. 2009-10-11 20:19:45 +00:00