freebsd-dev/sys
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
..
amd64 Revert 200594. This file isn't intended for these sorts of things. 2010-01-04 21:30:04 +00:00
arm Revert 200594. This file isn't intended for these sorts of things. 2010-01-04 21:30:04 +00:00
boot Fix typo: s/partion/partition/ 2010-01-02 17:32:40 +00:00
bsm Add audit events for process descriptor system calls, which will appear in 2009-09-29 21:25:59 +00:00
cam Add BIO_DELETE support to ada(4): 2009-12-28 20:08:01 +00:00
cddl Reduce diff against OpenSolaris - move Giant acquire/release to 2010-01-02 23:38:03 +00:00
compat Signal 0 is used to check the permission for current process to signal 2009-12-18 14:27:18 +00:00
conf Add support for Cavium Econa CNS11XX ARM boards. These boards were 2010-01-04 03:35:45 +00:00
contrib Delete old firmware. 2009-12-29 20:15:52 +00:00
crypto
ddb Among signal generation syscalls, only sigqueue(2) is allowed by POSIX 2009-11-17 11:39:15 +00:00
dev cardbus -> CardBus 2010-01-03 23:31:58 +00:00
fs The test for "same client" for the experimental nfs server over NFSv4 2010-01-03 20:08:10 +00:00
gdb
geom Slightly optimize XOR calculation. 2010-01-05 02:06:05 +00:00
gnu Remove unused code. 2009-12-03 18:16:14 +00:00
i386 Revert 200594. This file isn't intended for these sorts of things. 2010-01-04 21:30:04 +00:00
ia64 Revert 200594. This file isn't intended for these sorts of things. 2010-01-04 21:30:04 +00:00
isa Update d_mmap() to accept vm_ooffset_t and vm_memattr_t. 2009-12-29 21:51:28 +00:00
kern Use umtx to implement process sharable semaphore, to make this work, 2010-01-05 02:37:59 +00:00
kgssapi When the KOBJMETHOD() macro was updated, it resulted in the 2009-06-14 17:33:46 +00:00
libkern Move inet_aton() (specular to inet_ntoa(), already present in libkern) 2009-11-12 00:46:28 +00:00
mips Revert 200594. This file isn't intended for these sorts of things. 2010-01-04 21:30:04 +00:00
modules iwn(4) update. Notable changes: 2009-12-29 19:47:34 +00:00
net Various cleanup done in ipfw3-head branch including: 2010-01-04 19:01:22 +00:00
net80211 Fix typo in comment 2009-12-08 00:54:08 +00:00
netatalk Reverse misordered unlock and lock in at_control for netatalk phase I 2009-08-12 10:44:13 +00:00
netgraph Various cleanup done in ipfw3-head branch including: 2010-01-04 19:01:22 +00:00
netinet An existing incomplete ARP entry would expire a subsequent 2010-01-05 00:35:46 +00:00
netinet6 The IFA_RTSELF address flag marks a loopback route has been installed 2010-01-04 23:39:53 +00:00
netipsec Enable IPcomp by default. 2009-11-29 20:47:43 +00:00
netipx Use queue(9) instead of hand-crafted link lists for the global IPX 2009-06-24 20:57:50 +00:00
netnatm
netncp
netsmb Don't print out a message on loading a module. 'kldload -v' and 'kldstat 2009-09-10 18:33:08 +00:00
nfs Revert rev 192323 (nfs_common.c only): 2009-07-12 03:53:52 +00:00
nfsclient Add missing include to make LINT-VIMAGE build as well. 2009-12-27 10:10:38 +00:00
nfsserver Properly return an error reply if an NFS remove or link operation fails. 2009-12-03 20:59:28 +00:00
nlm Handle GRANTED_RES messages more gracefully: Send along a grant cookie 2009-10-07 19:50:14 +00:00
opencrypto In case the compression result is the same size as the orignal version, 2009-11-29 17:53:57 +00:00
pc98 Revert 200594. This file isn't intended for these sorts of things. 2010-01-04 21:30:04 +00:00
pci intpm/sb700: force polling mode if configured interrupt is SMI 2009-09-19 08:56:28 +00:00
powerpc Revert 200594. This file isn't intended for these sorts of things. 2010-01-04 21:30:04 +00:00
rpc (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument. 2009-12-28 22:56:30 +00:00
security Make mac_lomac(4) able to interpret NFSv4 access bits. 2010-01-03 17:19:14 +00:00
sparc64 Revert 200594. This file isn't intended for these sorts of things. 2010-01-04 21:30:04 +00:00
sun4v Revert 200594. This file isn't intended for these sorts of things. 2010-01-04 21:30:04 +00:00
sys Use umtx to implement process sharable semaphore, to make this work, 2010-01-05 02:37:59 +00:00
teken Place home and end before insert and delete. 2009-11-11 09:43:26 +00:00
tools Output a comment on top of each generated file explaining where it came 2009-10-25 09:48:21 +00:00
ufs Implement NFSv4 ACL support for UFS. 2009-12-21 19:39:10 +00:00
vm Update d_mmap() to accept vm_ooffset_t and vm_memattr_t. 2009-12-29 21:51:28 +00:00
xdr Add a check for a NULL mbuf ptr at the beginning of xdrmbuf_inline() 2009-08-12 16:27:51 +00:00
xen Correct bug introduced while purging the -ERRNO Linuxism from the 2009-12-29 23:28:13 +00:00
Makefile