freebsd-skq/usr.bin/truss
John Baldwin 53e1ffbbce The current POSIX semaphore implementation stores the _has_waiters flag
in a separate word from the _count.  This does not permit both items to
be updated atomically in a portable manner.  As a result, sem_post()
must always perform a system call to safely clear _has_waiters.

This change removes the _has_waiters field and instead uses the high bit
of _count as the _has_waiters flag.  A new umtx object type (_usem2) and
two new umtx operations are added (SEM_WAIT2 and SEM_WAKE2) to implement
these semantics.  The older operations are still supported under the
COMPAT_FREEBSD9/10 options.  The POSIX semaphore API in libc has
been updated to use the new implementation.  Note that the new
implementation is not compatible with the previous implementation.
However, this only affects static binaries (which cannot be helped by
symbol versioning).  Binaries using a dynamic libc will continue to work
fine.  SEM_MAGIC has been bumped so that mismatched binaries will error
rather than corrupting a shared semaphore.  In addition, a padding field
has been added to sem_t so that it remains the same size.

Differential Revision:	https://reviews.freebsd.org/D961
Reported by:	adrian
Reviewed by:	kib, jilles (earlier version)
Sponsored by:	Norse
2014-10-24 20:02:44 +00:00
..
amd64-fbsd32.c - Make truss thread-aware. 2012-09-16 14:38:01 +00:00
amd64-fbsd.c - Make truss thread-aware. 2012-09-16 14:38:01 +00:00
amd64-linux32.c - Make truss thread-aware. 2012-09-16 14:38:01 +00:00
amd64linux32.conf
arm-fbsd.c Unify interrupts bit definition and usage. While here remove PSR_C_bit. 2014-09-10 15:25:15 +00:00
extern.h Remove ia64. 2014-07-07 00:27:09 +00:00
fbsd32.conf
i386-fbsd.c - Make truss thread-aware. 2012-09-16 14:38:01 +00:00
i386-linux.c - Make truss thread-aware. 2012-09-16 14:38:01 +00:00
i386.conf
i386linux.conf
main.c Remove ia64. 2014-07-07 00:27:09 +00:00
Makefile
mips-fbsd.c - Make truss thread-aware. 2012-09-16 14:38:01 +00:00
powerpc64-fbsd.c - Make truss thread-aware. 2012-09-16 14:38:01 +00:00
powerpc-fbsd.c - Make truss thread-aware. 2012-09-16 14:38:01 +00:00
setup.c - Make truss thread-aware. 2012-09-16 14:38:01 +00:00
sparc64-fbsd.c - Make truss thread-aware. 2012-09-16 14:38:01 +00:00
syscall.h Decode the arguments passed to _umtx_op(). In particular, decode the 2014-10-13 16:37:06 +00:00
syscalls.c The current POSIX semaphore implementation stores the _has_waiters flag 2014-10-24 20:02:44 +00:00
truss.1
truss.h Revert r247300 for now. I'll post a new changeset for review. 2013-02-26 19:46:59 +00:00