This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[RFC/PATCH] RT-NPTL-2.2 1/5
- From: "Hu, Boris" <boris dot hu at intel dot com>
- To: <libc-alpha at sources dot redhat dot com>
- Cc: "Robustmutexes" <robustmutexes at lists dot osdl dot org>
- Date: Thu, 29 Apr 2004 17:52:13 +0800
- Subject: [RFC/PATCH] RT-NPTL-2.2 1/5
Makeconfig | 6
config.make.in | 1
configure.in | 8
nptl/ChangeLog.rtnptl | 697
++++++++++
nptl/Makefile | 23
nptl/Versions | 12
nptl/pthread_mutex_consistent_np.c | 22
nptl/pthread_mutex_getconsistency_np.c | 18
nptl/pthread_mutex_getfast_np.c | 19
nptl/pthread_mutex_getprioceiling.c | 24
nptl/pthread_mutex_init.c | 11
nptl/pthread_mutex_lock.c | 41
nptl/pthread_mutex_lock_waiting_for_mutex_whose_owner_died_np.c | 26
nptl/pthread_mutex_setconsistency_np.c | 25
nptl/pthread_mutex_setfast_np.c | 26
15 files changed, 946 insertions(+), 13 deletions(-)
--- robustmutexes/rtnptl/src/Makeconfig:1.1.1.1.2.4 Sun Apr 18
03:28:21 2004
+++ robustmutexes/rtnptl/src/Makeconfig Sun Apr 18 03:46:24 2004
@@ -633,10 +633,14 @@
+cflags := $(+cflags) $(+gccwarn)
+gcc-nowarn := -w
+# Enable Robust Mutex Supoort
+ifeq (yes,$(build-robust-mutex))
++cflags := $(+cflags) -DUSE_FUSYN_ROBUST_MUTEX
+endif
+
# Don't duplicate options if we inherited variables from the parent.
+cflags := $(sort $(+cflags))
-
# These are flags given to the C compiler to tell it to look for
include
# files (including ones given in angle brackets) in the current
directory,
# in the parent library source directory and in the include directory.
@@ -679,6 +683,7 @@
object-suffixes :=
CPPFLAGS-.o = $(pic-default)
CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
+
ifeq (yes,$(build-static))
libtype.o := lib%.a
object-suffixes += .o
--- robustmutexes/rtnptl/src/config.make.in:1.1.1.1.2.5 Sun Apr 4
02:41:21 2004
+++ robustmutexes/rtnptl/src/config.make.in Sun Apr 4 02:51:34 2004
@@ -89,6 +89,7 @@
add-ons = @subdirs@
cross-compiling = @cross_compiling@
force-install = @force_install@
+build-robust-mutex = @robust_mutex@
# Build tools.
CC = @CC@
--- robustmutexes/rtnptl/src/configure.in:1.1.1.1.2.7 Sun Apr 18
03:28:21 2004
+++ robustmutexes/rtnptl/src/configure.in Sun Apr 18 03:46:24 2004
@@ -121,6 +121,14 @@
[enable_check_abi=$enableval],
[enable_check_abi=no])
+dnl Arguments to enable or disable robust mutex feature.
+AC_SUBST(robust_mutex)
+AC_ARG_ENABLE([robust_mutex],
+ AC_HELP_STRING([--enable-robust-mutex],
+ [Build the library with robust mutexes
support @<:@default=no@:>@]),
+ [robust_mutex=$enableval],
+ [robust_mutex=default])
+
dnl Arguments to enable or disable building the static, shared,
profiled,
dnl and -fomit-frame-pointer libraries.
dnl I've disabled this for now since we cannot build glibc without
static
--- /dev/null Thu Apr 29 09:10:10 2004
+++ robustmutexes/rtnptl/src/nptl/ChangeLog.rtnptl Sat Apr 17
11:54:02 2004
@@ -0,0 +1,697 @@
+2004-4-17 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutexattr_init.c: Set the default prioceiling value
+ as MIN_USER_RT_PRIO.
+ * sysdeps/unix/sysv/linux/internaltypes.h: Add
NON_MUTEX_KIND_MASK
+ to show the bits reserved in mutexkind field.
+ * pthread_mutexattr_settype.c: Replace 0x80000000
+ with NON_MUTEX_KIND_MASK.
+ * pthread_mutexattr_gettype.c: Likewise.
+ * pthread_mutex_lock.c: Replace FUSYN_FL_RT_MASK
+ with NON_MUTEX_KIND_MASK.
+ * pthread_mutex_unlock.c: Likewise.
+ * pthread_mutex_trylock.c: Likewise.
+ * pthread_mutex_timedlock.c: Likewise.
+
+2004-4-13 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/internaltypes.h: Add MIN_USER_RT_PRIO.
+ * pthread_mutex_setprioceiling.c: Bug fix.
+ * pthread_mutex_getprioceiling.c: Likewise.
+ * pthread_mutexattr_setprioceiling.c: Likewise.
+ * pthread_mutexattr_getprioceiling.c: Likewise.
+ * sysdeps/pthread/pthread.h: Likewise.
+ * pthread_mutex_init.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add
PRIOCEILING_MASK
+ to FUSYN_FL_RT_MASK.
+ * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
+
+ * sysdeps/unix/sysv/linux/internaltypes.h: Reserver Bit 18-24 of
mutexkind
+ to record priority ceiling value, for NPTL has used the lowest
bits.
+ * pthread_mutex_getprioceiling.c: Likewise.
+ * pthread_mutex_setprioceiling.c: Likewise.
+ * pthread_mutexattr_getprioceiling.c: Likewise.
+ * pthread_mutexattr_setprioceiling.c: Likewise.
+
+2004-4-8 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/internaltypes.h: Remove FULOCK_SPIN_*
+ and its bit comment in pthread_mutexattr. The new spins field of
+ pthread_mutex_t is used instead.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/lowlevelrtlock.c: Likewise.
+ * pthread_mutexattr_getspin_np.c: Removed.
+ * pthread_mutexattr_setspin_np.c: Removed.
+ * Versions: Remove pthread_mutexattr_{g,s}etspin_np.
+ * tst-spin-mode1.c: Removed.
+ * Makefile: Remove tst-spin-mode1,
pthread_mutexattr_{g,s}etspin_np.
+
+2004-3-30 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Remove
+ __prioceiling field from pthread_mutex_t.
+ * pthread_mutex_init.c: Likewise.
+
+2004-3-25 Greg Weeks <greg.weeks@timesys.com>
+
+ * pthread_mutex_setprioceiling.c: Remove errno variable.
+ * pthread_mutexattr_setprioceiling.c: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Add
+ RT-NPTL support to powerpc.
+ * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/pthread_cond_broadcast.c:
+ New file.
+ * sysdeps/unix/sysv/linux/powerpc/pthread_cond_signal.c:
+ New file.
+ * sysdeps/unix/sysv/linux/powerpc/pthread_cond_timedwait.c:
+ New file.
+ * sysdeps/unix/sysv/linux/powerpc/pthread_cond_wait.c:
+ New file.
+
+
+2004-3-23 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/lowlevelrtlock.c: Enable the
+ unserialized waking up mode based on the latest fusyn
+ kernel modification.
+
+
+2004-3-3 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/internaltypes.h: Add comments
+ to get Bit 24 of mutexkind for the spinning switching of
+ fulocks.
+ * Versions: Add pthread_mutexattr_{g,s}etspin_np.
+ * pthread_mutexattr_getspin_np.c: New file.
+ * pthread_mutexattr_setspin_np.c: Likewise.
+ * sysdeps/pthread/pthread.h: Add PTHREAD_MUTEX_SPIN_NP.
+ * sysdeps/unix/sysv/linux/lowlevelrtlock.c: Add FULOCK_FL_SPIN
+ support.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
+ * Makefile: Add pthread_mutexattr_{g,s}etspin_np.
+
+ * tst-spin-mode1.c: New file.
+ * Makefile: Add tst-spin-mode1.
+
+2004-2-18 Dave Howell <david.p.howell@intel.com>
+
+ * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
+ * sysdeps/unix/sysv/linux/ia64/lowlevelrtlock.c
+ Removed lowlevelrtlock.c, now uses version above ia64.
+ Updated lowlevellock.h to use common lowlevelrtlock.c.
+
+2004-2-17 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutex_consistent_np.c: New file.
+ * Versions: Add pthread_mutex_consistent_np.
+ * sysdeps/pthread/pthread.h: Likewise.
+ * Makefile: Likewise.
+
+2004-2-13 Dave Howell <david.p.howell@intel.com>
+
+ * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
+ * sysdeps/unix/sysv/linux/ia64/lowlevelrtlock.c
+ Updates to incorporate changes for i386 in ia64 port
+
+2004-2-13 Boris Hu <boris.hu@intel.com>
+
+ * tst-fast1.c: New file.
+ * tst-serial1.c: New file.
+ * Makefile: Add tst-fast1, tst-serial1,
+ pthread_mutexattr_{g,s}etfast_np,
+ pthread_mutexattr_{g,s}etserial_np,
pthread_mutex_{g,s}etfast_np.
+ * sysdeps/pthread/pthread.h: Add
pthread_mutexattr_{g,s}etfast_np,
+ pthread_mutexattr_{g,s}etserial_np,
pthread_mutex_{g,s}etfast_np.
+
+2004-2-11 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/internaltypes.h: Rename
+ MUTEX_SERIAL_BITMASK and MUTEX_FASTPATH_BITMASK to
+ FULOCK_SERIAL_MODE and FULOCK_FASTPATH_MODE.
+ * pthread_mutexattr_setfast_np.c: Likewise.
+ * pthread_mutexattr_getfast_np.c: Likewise.
+ * pthread_mutex_getfast_np.c: Likewise.
+ * pthread_mutex_setfast_np.c: Likewise.
+ * pthread_mutexattr_setserial_np.c: Likewise.
+ * pthread_mutexattr_getserial_np.c: Likewise.
+ * sysdeps/unix/sysv/linux/lowlevelrtlock.c: Likewise.
+ * pthread_mutexattr_setrobust_np.c: Likewise.
+ * pthread_mutexattr_setprotocol.c: Likewise.
+
+2004-2-10 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutexattr_setrobust_np.c: Add MUTEX_SERIAL_BITMASK
+ when the mutex is robust.
+ * pthread_mutexattr_setprotocol.c: Likewise.
+ * pthread_mutex_init.c: Use PTHREAD_MUTEX_ROBUST_INIT_NP
+ instead of PTHREAD_MUTEX_ROBUST_CONSISTENT_NP.
+ * sysdeps/unix/sysv/linux/lowlevelrtlock.c: Avoid to wakeup
+ INT_MAX waiters.
+
+2004-2-6 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutexattr_getserial_np.c: New file.
+ * pthread_mutexattr_setserial_np.c: New file.
+
+2004-2-6 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutexattr_setprioceiling.c: Bug fix. Clean
+ the old value before setting the new value.
+ * pthread_mutexattr_setprotocol.c: Likewise.
+ * pthread_mutexattr_setrobust_np.c: Likewise.
+ * pthread_mutexattr_getrobust_np.c: Typo bug fix.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add
+ FUSYN_FL_RT2K_MASK to the new flags.
+ * sysdeps/unix/sysv/linux/lowlevelrtlock.c: Add FULOCK_FL_KCO
+ support.
+ * pthread_mutex_init.c: Bug fix.
+
+2004-2-5 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/internaltypes.h: Add comments
+ to get Bit 25 and 26 of mutexkind for the switching of
+ fast-path and KCO mode, serialized or unserialized.
+ Add MUTEX_FAST_BITMASK and MUTEX_SERIAL_BITMASK.
+ * Versions: Add pthread_mutexattr_{g,s}etfast_np,
+ pthread_mutex_{g,s}etfast_np.
+ * pthread_mutexattr_getfast_np.c: New file.
+ * pthread_mutexattr_setfast_np.c: Likewise.
+ * pthread_mutex_getfast_np.c: Likewise.
+ * pthread_mutex_setfast_np.c: Likewise.
+ * sysdeps/pthread/pthread.h: Add PTHREAD_MUTEX_FASTPATH_NP, etc
+ switching modes.
+
+2004-2-5 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c:
+ Roll back LLL_RTMUTEX_LOCK() to LLL_MUTEX_LOCK() definition
+ to delay the support runtime switching RM and normal mutex till
it is really needed.
+ * pthread_mutex_lock.c: Likewise.
+ * pthread_mutex_trylock.c: Likewise.
+ * pthread_mutex_timedlock.c: Likewise.
+ * pthread_mutex_unlock.c: Likewise.
+ * sysdeps/unix/sysv/linux/lowlevelrtlock.c:
+ Rename *fulock_consistency() to *fulock_ctl(), 'enum fulock_con'
+ to 'enum fulock_ctl' to adapt to the fusyn kernel change.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
+
+2004-2-3 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/lowlevelrtlock.c:
+ Rename VFULOCK_KCO to VFULOCK_WP.
+
+2004-2-2 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c:
+ Modify LLL_MUTEX_LOCK() to LLL_RTMUTEX_LOCK() definition
+ in RM situation to support runtime switching RM and normal
+ mutex.
+ * pthread_mutex_lock.c: Likewise.
+ * pthread_mutex_trylock.c: Likewise.
+ * pthread_mutex_timedlock.c: Likewise.
+ * pthread_mutex_unlock.c: Likewise.
+
+2004-2-2 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c:
+ Moved to sysdeps/unix/sysv/linux directory.
+
+2004-1-30 Dave Howell <david.p.howell@intel.com>
+
+ * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
+ * sysdeps/unix/sysv/linux/ia64/lowlevelrtlock.c
+ Updates to track is_mutexattr_robust() changes for i386
+ * Makefile
+ * init.c
+ * pthread_mutex_lock.c
+ * pthread_mutex_timedlock.c
+ * pthread_mutex_unlock.c
+ Change to remove references to eventlog.h/eventlog
+
+2004-1-17 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c:
+ Add is_mutexattr_robust().
+
+2004-1-13 Boris Hu <boris.hu@intel.com>
+
+ * glibc/configure.in: Add --enable-robust-mutex option.
+ * glibc/config.make.in: Define build-robust-mutex.
+ * glibc/Makeconfig: Add USE_FUSYN_ROBUST_MUTEX based on
+ build-robust-mutex.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove
+ USE_FUSYN_ROBUST_MUTEX definition.
+
+2004-1-6 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutex_init.c: Add RM reinitialization support.
+
+2003-12-26 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c:
+ Replace INLINE_SYSCALL with INTERNAL_SYSCALL.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
+
+2003-12-22 Dave Howell <david.p.howell@intel.com>
+
+ * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
+ * sysdeps/unix/sysv/linux/ia64/lowlevelrtlock.c
+ * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
+ Updates to sync up with i386 recent changes.
+
+2003-12-9 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutex_unlock.c: mutex->__data.__owner order bug
+ fix.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h:
+ lll_futex_timed_wait()/lll_futex_requeue() return negative
errno.
+
+2003-12-3 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutex_lock.c: Redefine LLL_MUTEX_* macro
+ to enable/disable rt featuer by USE_FUSYN_ROBUST_MUTEX.
+ * pthread_mutex_unlock.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.c:
+ Add LLL_CMUTEX_* to enable/disable rt featuer by
+ USE_FUSYN_ROBUST_MUTEX.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.c:
+ Likewise.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.c:
+ Likewise.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h:
+ Add lll_rtmutex_{g,s}et_consistency definitions for normal NPTL.
+ * INSTALL-rtnptl-upon-fusyn: New file.
+ * rtnptl___2_0: A new version.
+
+2003-12-2 Dave Howell <david.p.howell@intel.com>
+
+ * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
+ * sysdeps/unix/sysv/linux/ia64/lowlevelrtlock.c
+ Updates to sync with i386 changes. Fixes for INLINE_SYSCALL()
+ return value checks that differed from i386. Added GPL header
+ info to lowlevelrtlock.c.
+
+2003-12-2 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutexattr_getprotocol.c: Replace FUSYN_FL_*
+ with FULOCK_FL_* from kernel fulock.h file.
+ * pthread_mutexattr_setprotocol.c: Likewise.
+ * pthread_mutexattr_getrobust_np.c: Likewise.
+ * pthread_mutexattr_setrobust_np.c: Likewise.
+ * pthread_mutex_unlock.c: Likewise.
+ * pthread_mutex_trylock.c: Code clean.
+
+2003-12-2 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h:
+ __LK_FL bug fix reported by Selbak, Rolla.
+ * pthread_mutex_setconsistency_np.c: Bug fix provided
+ by Selbak, Rolla.
+
+2003-12-1 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.c:
+ FIXME code clean.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.c:
+ Likewise.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.c:
+ Likewise.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.c:
+ Likewise.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h:
+ Hack lll_cmutex_lock() to promise to get the lock.
+ * pthread_mutex_getconsistency_np.c: Add const qualifier.
+ * sysdeps/pthread/pthread.h: Likewise.
+
+2003-12-1 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.c:
+ Merge nptl process shared condvar bug fix.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.c:
+ Likewise.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.c:
+ Likewise.
+
+2003-11-24 Boris Hu <boris.hu@intel.com>
+
+ * merge glibc___200311220227 into rtnptl___branch.
+
+2003-11-23 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/pthread/createthread.c: Remove pid signature stuff.
+ * init.c: Likewise.
+
+2003-11-23 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutex_unlock.c: Move ERRORCHECK and
+ RECURSIVE mutex from kernel to the user space.
+ * pthread_mutex_lock.c: Likewise.
+ * pthread_mutex_trylock.c: Likewise.
+ * pthread_mutex_timedlock.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h:
+ Remove RECURSIVE and ERRORCHECK flags.
+ * rtnptl___1_10: All nptl test cases passed and it bases
+ on fusyn-1.13.
+
+2003-11-22 Boris Hu <boris.hu@intel.com>
+
+ * rtnptl___1_9: Pass all tst-cond*.
+
+2003-11-21 Dave Howell <david.p.howell@intel.com>
+
+ * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
+ * sysdeps/unix/sysv/linux/ia64/lowlevelrtlock.c
+ * sysdeps/unix/sysv/linux/ia64/pthread_cond_broadcast.c
+ * sysdeps/unix/sysv/linux/ia64/pthread_cond_signal.c
+ * sysdeps/unix/sysv/linux/ia64/pthread_cond_timedwait.c
+ * sysdeps/unix/sysv/linux/ia64/pthread_cond_wait.c
+ Updates to ia64 versions to match changes to i386 for recent
+ kernel changes.
+ Made pthread_cond_*.c just include ../i386/pthread_cond*.c, to
+ track i386 implementation. When this is made default, change
+ to put it common for all architectures.
+
+2003-11-21 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutex_lock.c:
+ Add __nusers support for pthread_mutex_destroy will check it.
+ * pthread_mutex_unlock.c: Likewise.
+ * pthread_mutex_timedlock.c: Likewise.
+ * pthread_mutex_trylock.c: Likewise.
+
+2003-11-21 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/syv/linux/fork.c: Remove pid signature.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove
+ all lll_fucond_* stuff.
+ Remove lll_rtmutex_make_signature.
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c: Likewise.
+ * pthread_mutex_unlock.c: Add the support to detect other tid
try
+ to unlock the lock for ERRORCHECK.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h: (Inaky)
+ lll_futex_wait/lll_futex_wake bug fix.
+ lll_futex_requeue replace with FUTEX_WAKE.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.c:
+ Bug fix (Inaky).
+
+2003-11-20 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h:
+ Add flags parameters to __lll_rtmutex_lock/unlock.
+ Add lll_cmutex_lock/unlock.
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c: Likewise.
+ * sysdeps/unix/sysv/linux/pthread_mutex_cond_unlock.c: Removed.
+ * sysdeps/unix/sysv/linux/Makefile: Remove
pthread_mutex_cond_unlock.
+ * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c:
+ Restore LLL_MUTEX_LOCK to lll_rtmutex_lock().
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.c:
+ Make the __data.__lock to be a robust lock.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.c:
Likewise.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.c:
Likewise.
+
+2003-11-20 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.c:
+ Switch condvar from ufucond to ufuqueue.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwatic.:
Likewise.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_signal: Likewise.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.c:
Likewise.
+ * sysdeps/unix/sysv/linux/pthread_mutex_cond_unlock.c: New file.
+ * sysdeps/unix/sysv/linux/Makefile: Add
pthread_mutex_cond_unlock.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h:
+ Add lll_rtmutex_cond_lock/unlock definitions.
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c:
+ Add __lll_rtmutex_cond_lock/unlock implementations.
+
+2003-11-19 Dave Howell <david.p.howell@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h
+ * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
+ * sysdeps/unix/sysv/linux/ia64/lowlevelrtlock.c
+ Fixed typo in i386/lowlevellock.h,
+ pthread_mutex/consistent_np -> pthread_mutex_consistency_np
+ Updates to ia64 versions to match changes to i386 for recent
+ kernel changes.
+
+2003-11-18 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c:
+ Add FULOCK_FL_RECURSIVE, FULOCK_FL_ERROR_CHK support.
+ * pthread_mutex_lock.c: Remove recursive and error
+ check mutex handlering code and let the fusyn kernel
+ do for us.
+ * pthread_mutex_timedlock.c: Likewise.
+ * pthread_mutex_trylock.c: Likewise.
+ * pthread_mutex_unlock.c: Likewise.
+
+2003-11-18 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.c:
+ Change the cancelability type to PTHREAD_CANCEL_ASYNCHRONOUS
before
+ sys_ufucond_wait.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.c:
Likewise.
+ * sysdeps/unix/sysv/linux/ia64/pthread_cond_wait.c: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/pthread_cond_timedwait.c:
Likewise.
+
+2003-11-17 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c:
+ Add is_mutex_robust().
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h:
+ Add is_mutex_robust() prototype declaration.
+ * pthread_mutex_lock.c:
+ Judge the mutex type with is_mutex_robust().
+ * pthread_mutex_timedlock.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.c:
+ Add non-robust mutex OWNERDEAD handlering.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.c:
Likewise.
+
+2003-11-13 Dave Howell <david.p.howell@intel.com>
+
+ * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
+ * sysdeps/unix/sysv/linux/ia64/lowlevelrtlock.c
+ * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
+ Added changes for ia64 port updates. Should be in sync with
+ i386 files at this point
+ * sysdeps/unix/sysv/linux/ia64/pthread_cond_broadcast.c
+ * sysdeps/unix/sysv/linux/ia64/pthread_cond_signal.c
+ * sysdeps/unix/sysv/linux/ia64/pthread_cond_timedwait.c
+ * sysdeps/unix/sysv/linux/ia64/pthread_cond_wait.c
+ Duplicated from i386 side, instead of copying up to linux,
+ as this implies that kernel support is there for ufucond's.
+ We may still want to do this eventually but this seemd to
+ be the safe route for now.
+ * rtnptl___1_8: Add ia64 rtnptl feature support.
+
+2003-11-13 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.c:
+ Update mutex data members to reflect the lock/unlock situations.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.c:
Likewise.
+ * rtnptl___1_7: It passes tst-cond1-4.
+
+2003-11-12 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c:
+ Add __LK_FL() to get the mutex flags.
+
+2003-11-11 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h:
+ Add _POSIX_THREAD_PRIO_INHERIT, _POSIX_THREAD_PRIO_PROTECT,
+ _POSIX_THREAD_ROBUST_MUTEX_NP.
+ * glibc/sysdeps/generic/bits/confname.h:
+ Add _SC_THREAD_ROBUST_MUTEX_NP.
+ * glibc/sysdeps/posix/sysconf.c:
+ Add _SC_THREAD_ROBUST_MUTEX_NP support.
+
+2003-11-10 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.c:
+ Pass the address of mutex->__data.__lock to the kernel instead
of
+ mutex.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.c:
Likewise.
+
+2003-11-07 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c:
+ Add timespec calculation in __lll_cond_timedwait().
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c:
+ acas()-> atomic_compare_and_exchange_val_acq()
+ __vfulock_acas()->!atomic_comare_and_exchange_bool_acq()
+ * pthread_mutex_lock_waiting_for_mutex_whose_owner_died_np:
+ (void *)-1 to indicate endless waiting instead of 0.
+ * pthread_mutex_trylock.c: Likewise.
+ * pthread_mutex_lock.c: Likewise.
+ * rtnptl___1_6: pthread_cond_* are sitting on ufucond layer now.
+
+2003-11-06 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
Removed.
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
Removed.
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
Removed.
+ * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
Removed.
+ * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S:
Removed.
+ * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S:
Removed.
+ * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S:
Removed.
+ * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S:
Removed.
+ * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S:
Removed.
+ * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S:
Removed.
+ * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
Removed.
+ * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S:
Removed.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.c: New
file.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.c: New file.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.c: New
file.
+ * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.c: New file.
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c:
+ Add __lll_fucond_* functions.
+ * sysdeps/unix/sysv/linux/i386/lowlevllock.h:
+ Add __lll_fucond_* functions declaration.
+
+2003-11-06 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutexattr_getprotocol.c:
+ RM bit and PI/PP bit swaps according FULOCK_FL_*. Update
+ its comments.
+ * pthread_mutexattr_setprotocol.c: Likewise.
+ * pthread_mutexattr_setrobust_np.c: Likewise.
+ * pthread_mutexattr_getrobust_np.c: Likewise.
+ * sysdeps/unix/sysv/linux/internaltypes.h: Likewise.
+
+2003-11-06 Boris Hu <boris.hu@intel.com>
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h:
+ FUSYN_FL_* modification according to FULOCK_FL_* definition.
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c:
+ There is a bit difference between the user space flags and the
kernel.
+ * sysdeps/pthread/pthread.h:
+ Robust mutex states update according to fulock_con.
+ * pthread_mutex_setconsistency_np.c: Likewise.
+ * pthread_mutex_setconsistency_np.c:
+ Return 0 instead of the value of sys_ufulock_consistency().
+ * rtnptl___1_5: It passes all robust-mode2 tests.
+
+2003-11-05 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutex_lock_waiting_for_mutex_whose_owner_died_np.c:
New file.
+ * pthread_mutex_owner_dead_np.c: Removed.
+ * Makefile: Rename pthread_mutex_owner_dead_np to
+ pthread_mutex_lock_waiting_for_mutex_whose_owner_died_np.
+ * Versions: Likewise.
+ * pthread_mutex_lock.c: Likewise.
+ * pthread_mutex_timedlock.c: Likewise.
+ * pthread_mutex_trylock.c: Likewise.
+
+2003-11-05 Boris Hu <boris.hu@intel.com>
+
+ * pthread_mutex_owner_dead_np.c: New file.
+ * Makefile: Add pthread_mutex_owner_dead_np.
+ * Versions: Add pthread_mutex_owner_dead_np.
+
+ * pthread_mutex_lock.c:
+ ESRCH->EOWNERDEAD, EBADR->ENOTRECOVERABLE according to fusyn
+ implementation.
+ abort() -> pthread_mutex_owner_dead_np() when owner dead occurs
+ to non-RM mutex.
+ * pthread_mutex_timedlock.c: Likewise.
+ * pthread_mutex_trylock.c: Likewise.
+ * rtnptl___1_4: With pthread_mutex_owner_dead_np support.
+
+2003-11-04 Boris Hu <boris.hu@intel.com>
+
+ * TODO.rtnptl: New file.
+ * README.rtnptl: New file.
+ * pthread_mutexattr_getprioceiling.c: New file.
+ * pthread_mutexattr_setprioceiling.c: New file.
+ * pthread_mutex_getprioceiling.c: New file.
+ * pthread_mutex_setprioceiling.c: New file.
+ * sysdeps/unix/sysv/linux/internaltypes.h:
+ Bit 0-6 of pthread_mutexattr is reserved to record priority
+ ceiling value.
+ Add PRIOCEILING_MASK and MAX_USER_RT_PRIO definition.
+ * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h:
+ Add __prioceiling to pthread_mutex_t;
+ * Makefile: Add pthread_mutexattr_{g,s}etprioceiling,
+ pthread_mutex_{g,s}etprioceiling.
+ * Versions: Add pthread_mutexattr_{g,s}etprioceiling,
+ pthread_mutex_{g,s}etprioceiling.
+ * pthread_mutex_init.c:
+ Add priority ceiling support.
+ * sysdeps/pthread/pthread.h:
+ Add pthread_mutexattr_{g,s}etprioceiling,
+ pthread_mutex_{g,s}etprioceiling protype.
+ * rtnptl___1_3: The tag records after adding the get/set
+ priority ceiling value features.
+
+2003-10-31 Boris Hu <boris.hu@intel.com>
+
+ * rtnptl___1_2:
+ Pass all nptl-0.60 test cases except tst-cond2 and tst-signal3
+ according to the diff between outputs of the normal nptl-0.60
+ and that of rtnptl___1_2.
+
+2003-10-31 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c:
+ Add EINTR support. Continue to try to get the lock when the
return
+ value of sys_ufulock_lock() is -EINTR instead of directly
returnning.
+
+2003-10-29 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h:
+ do {} while(0) protection to the debug function.
+
+2003-10-29 Boris Hu <boris.hu@intel.com>
+
+ * sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c
(__lll_rtmutex_trylock):
+ Update it according to kernel-lock.h change.
+
+2003-10-29 Boris Hu <boris.hu@intel.com>
+
+ * nptl/sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c: Change
+ ___lll_rtmutex_unlock() according to kernel-lock.h change.
+ * Add rtnptl___1_1 tag: The version builds ok and passes many
+ tests including tst-mutex5, tst-mutex7 against fusyn-1.6. But
+ it would fail in tst-cond2.
+
+2003-10-28 Boris Hu <boris.hu@intel.com>
+
+ * nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c:
Redirect
+ pthread_mutex_cond_lock() to lll_rtmutex_lock() instead of
+ lll_mutex_cond_lock().
+
+2003-10-28 Boris Hu <boris.hu@intel.com>
+
+ * nptl/sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c: Pass
+ flags & FULOCK_FL_USER_MK to sys_ufulock_*() instead of flags
+ directly.
+
+2003-10-26 Boris Hu <boris.hu@intel.com>
+
+ * nptl/sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c: Get the
+ return value of INLINE_SYSCALL from errno when it returns -1.
+
+2003-10-26 Boris Hu <boris.hu@intel.com>
+
+ * nptl/sysdeps/unix/sysv/linux/i386/lowlevelrtlock.c: New file.
+ * nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S:
+ Code clean.
+ * nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h: Move
+ ___lll_rtmutex_* into lowlevelrtmutex.c to accelerate the
recompile
+ process.
+ * nptl/Makefile: Add lowlevelrtlock.c.
+
+2003-10-25 Boris Hu <boris.hu@intel.com>
+
+ * nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h:
+ ___lll_rtmutex_timedlock() pass sys_ufulock_lock() with the
relative
+ timespec instead of the absolute timespec.
+
+2003-10-21 Boris Hu <boris.hu@intel.com>
+
+ * The first version against fusyn.
+
+
+
--- robustmutexes/rtnptl/src/nptl/Makefile:1.1.1.1.2.9 Sun Apr 4
02:41:31 2004
+++ robustmutexes/rtnptl/src/nptl/Makefile Thu Apr 8 09:22:02 2004
@@ -53,10 +53,28 @@
pthread_mutex_init pthread_mutex_destroy \
pthread_mutex_lock pthread_mutex_trylock \
pthread_mutex_timedlock pthread_mutex_unlock \
+ pthread_mutex_getconsistency_np \
+ pthread_mutex_setconsistency_np \
+ pthread_mutex_consistent_np \
+ pthread_mutex_getprioceiling \
+ pthread_mutex_setprioceiling \
+ pthread_mutex_setfast_np \
+ pthread_mutex_getfast_np \
+
pthread_mutex_lock_waiting_for_mutex_whose_owner_died_np \
pthread_mutexattr_init pthread_mutexattr_destroy \
pthread_mutexattr_getpshared \
pthread_mutexattr_setpshared \
pthread_mutexattr_gettype
pthread_mutexattr_settype \
+ pthread_mutexattr_getrobust_np \
+ pthread_mutexattr_setrobust_np \
+ pthread_mutexattr_getprotocol \
+ pthread_mutexattr_setprotocol \
+ pthread_mutexattr_getprioceiling \
+ pthread_mutexattr_setprioceiling \
+ pthread_mutexattr_getfast_np \
+ pthread_mutexattr_setfast_np \
+ pthread_mutexattr_getserial_np \
+ pthread_mutexattr_setserial_np \
pthread_rwlock_init pthread_rwlock_destroy \
pthread_rwlock_rdlock pthread_rwlock_timedrdlock \
pthread_rwlock_wrlock pthread_rwlock_timedwrlock \
@@ -102,6 +120,7 @@
pt-longjmp pt-cleanup\
cancellation \
lowlevellock \
+ lowlevelrtlock \
pt-vfork \
ptw-write ptw-read ptw-close ptw-fcntl ptw-accept
\
ptw-connect ptw-recv ptw-recvfrom ptw-recvmsg
ptw-send \
@@ -238,7 +257,9 @@
tst-sched1 \
tst-backtrace1 \
tst-oddstacklimit \
- tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x
+ tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \
+ tst-fast1 \
+ tst-serial1
# Files which must not be linked with libpthread.
tests-nolibpthread = tst-unload
--- robustmutexes/rtnptl/src/nptl/Versions:1.1.1.1.2.1 Fri Mar 26
02:41:34 2004
+++ robustmutexes/rtnptl/src/nptl/Versions Thu Apr 8 09:22:02 2004
@@ -212,6 +212,18 @@
# Proposed API extensions.
pthread_tryjoin_np; pthread_timedjoin_np;
+ pthread_mutexattr_getrobust_np; pthread_mutexattr_setrobust_np;
+ pthread_mutex_lock_waiting_for_mutex_whose_owner_died_np;
+
+ # 1003.1-2001 function (realtime)
+ pthread_mutexattr_getprotocol; pthread_mutexattr_setprotocol;
+ pthread_mutex_getconsistency_np; pthread_mutex_setconsistency_np;
+ pthread_mutex_consistent_np;
+ pthread_mutexattr_getprioceiling; pthread_mutexattr_setprioceiling;
+ pthread_mutex_getprioceiling; pthread_mutex_setprioceiling;
+ pthread_mutexattr_getfast_np; pthread_mutexattr_setfast_np;
+ pthread_mutexattr_getserial_np; pthread_mutexattr_setserial_np;
+ pthread_mutex_getfast_np; pthread_mutex_setfast_np;
# New cancellation cleanup handling.
__pthread_register_cancel; __pthread_unregister_cancel;
--- /dev/null Thu Apr 29 09:10:10 2004
+++ robustmutexes/rtnptl/src/nptl/pthread_mutex_consistent_np.c Tue Mar
30 09:20:22 2004
@@ -0,0 +1,22 @@
+/*
+ * (C) 2004 Intel Corporation
+ * Boris Hu <boris.hu@intel.com>.
+ *
+ * Distributed under the FSF's LGPL license, v2 or later. */
+
+#include <errno.h>
+#include "pthreadP.h"
+#include <bits/posix_opt.h>
+
+int
+pthread_mutex_consistent_np (pthread_mutex_t *mutex)
+{
+ int result;
+
+#ifndef _POSIX_THREAD_PRIO_INHERIT
+ return ENOSYS;
+#endif
+ result = lll_rtmutex_set_consistency (mutex->__data.__lock,
+
PTHREAD_MUTEX_ROBUST_CONSISTENT_NP);
+ return result;
+}
--- /dev/null Thu Apr 29 09:10:10 2004
+++ robustmutexes/rtnptl/src/nptl/pthread_mutex_getconsistency_np.c
Tue Mar 30 09:20:22 2004
@@ -0,0 +1,18 @@
+/*
+ * (C) 2002-2003 Intel Corporation
+ * Bing Wei Liu <bing.wei.liu@intel.com>.
+ *
+ * Reimplement to sync with fusyn and POSIX spec.
+ * (C) 2003 Intel Corporation Boris Hu <boris.hu@intel.com>
+ *
+ * Distributed under the FSF's LGPL license, v2 or later. */
+
+
+#include <errno.h>
+#include "pthreadP.h"
+
+int
+pthread_mutex_getconsistency_np(const pthread_mutex_t *mutex, int
*state)
+{
+ return lll_rtmutex_get_consistency (mutex->__data.__lock, state);
+}
--- /dev/null Thu Apr 29 09:10:10 2004
+++ robustmutexes/rtnptl/src/nptl/pthread_mutex_getfast_np.c Tue Mar
30 09:20:22 2004
@@ -0,0 +1,19 @@
+/*
+ * (C) 2004 Intel Corporation
+ * Boris Hu <boris.hu@intel.com>
+ *
+ * Distributed under the FSF's LGPL license, v2 or later. */
+
+
+#include <pthreadP.h>
+
+
+int
+pthread_mutex_getfast_np (const pthread_mutex_t *mutex,
+ int *fast_mode)
+{
+ *fast_mode = mutex->__data.__kind & FULOCK_FASTPATH_MODE
+ ? PTHREAD_MUTEX_FASTPATH_NP : PTHREAD_MUTEX_KCO_NP;
+
+ return 0;
+}
--- /dev/null Thu Apr 29 09:10:10 2004
+++ robustmutexes/rtnptl/src/nptl/pthread_mutex_getprioceiling.c
Tue Apr 13 11:37:02 2004
@@ -0,0 +1,24 @@
+/*
+ * (C) 2003 Intel Corporation
+ * Boris Hu <boris.hu@intel.com>
+ *
+ * Distributed under the FSF's LGPL license, v2 or later. */
+
+
+#include <pthreadP.h>
+
+
+int
+pthread_mutex_getprioceiling (const pthread_mutex_t *__mutex,
+ int *__prioceiling)
+{
+ /* Use Bit PRIOCEILING_OFFSET - PRIOCEILING_OFFSET + 6 to
+ * indicate the priority ceiling value.
+ * -- MIN_USER_RT_PRIO ~~ MAX_USER_RT_PRIO
+ */
+
+ *__prioceiling = (__mutex->__data.__kind
+ & PRIOCEILING_MASK) >> PRIOCEILING_OFFSET;
+
+ return 0;
+}
--- robustmutexes/rtnptl/src/nptl/pthread_mutex_init.c:1.1.1.1.2.1
Fri Mar 26 02:41:35 2004
+++ robustmutexes/rtnptl/src/nptl/pthread_mutex_init.c Sat Apr 17
11:54:02 2004
@@ -42,15 +42,22 @@
/* Clear the whole variable. */
memset (mutex, '\0', __SIZEOF_PTHREAD_MUTEX_T);
-
+
/* Copy the values from the attribute. */
- mutex->__data.__kind = imutexattr->mutexkind & ~0x80000000;
+ mutex->__data.__kind = imutexattr->mutexkind;
+
+ if (__builtin_expect (!(mutex->__data.__kind & PRIOCEILING_MASK), 1))
+ mutex->__data.__kind |= (MIN_USER_RT_PRIO << PRIOCEILING_OFFSET);
/* Default values: mutex not used yet. */
// mutex->__count = 0; already done by memset
// mutex->__owner = 0; already done by memset
// mutex->__nusers = 0; already done by memset
// mutex->__spins = 0; already done by memset
+
+ if (__builtin_expect (is_mutexattr_robust (imutexattr), 0))
+ lll_rtmutex_set_consistency (mutex->__data.__lock,
+ PTHREAD_MUTEX_ROBUST_INIT_NP);
return 0;
}
--- robustmutexes/rtnptl/src/nptl/pthread_mutex_lock.c:1.1.1.1.2.1
Fri Mar 26 02:41:35 2004
+++ robustmutexes/rtnptl/src/nptl/pthread_mutex_lock.c Sat Apr 17
11:54:02 2004
@@ -2,6 +2,9 @@
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+ Redirect lowlevellock to use Fast User SYNchronization(fusyn).
+ Boris Hu <boris.hu@intel.com>, 2003.
+
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@@ -24,8 +27,19 @@
#ifndef LLL_MUTEX_LOCK
-# define LLL_MUTEX_LOCK(mutex) lll_mutex_lock (mutex)
-# define LLL_MUTEX_TRYLOCK(mutex) lll_mutex_trylock (mutex)
+# ifdef USE_FUSYN_ROBUST_MUTEX
+# define LLL_MUTEX_LOCK(mutex, tid) \
+ do { \
+ result = lll_rtmutex_lock (mutex,tid); \
+ if (__builtin_expect (0 != result, 0)) \
+ goto out_err; \
+ } while (0)
+# define LLL_MUTEX_TRYLOCK(mutex, tid) \
+ lll_rtmutex_trylock(mutex, tid)
+# else
+# define LLL_MUTEX_LOCK(mutex, tid) lll_mutex_lock(mutex)
+# define LLL_MUTEX_TRYLOCK(mutex, tid) lll_mutex_trylock (mutex)
+# endif
#endif
@@ -36,8 +50,9 @@
assert (sizeof (mutex->__size) >= sizeof (mutex->__data));
pid_t id = THREAD_GETMEM (THREAD_SELF, tid);
-
- switch (__builtin_expect (mutex->__data.__kind,
PTHREAD_MUTEX_TIMED_NP))
+ int result = 0;
+ switch (__builtin_expect (mutex->__data.__kind &
~NON_MUTEX_KIND_MASK,
+ PTHREAD_MUTEX_TIMED_NP))
{
/* Recursive mutex. */
case PTHREAD_MUTEX_RECURSIVE_NP:
@@ -55,7 +70,7 @@
}
/* We have to get the mutex. */
- LLL_MUTEX_LOCK (mutex->__data.__lock);
+ LLL_MUTEX_LOCK (mutex->__data.__lock, id);
mutex->__data.__count = 1;
break;
@@ -73,14 +88,14 @@
case PTHREAD_MUTEX_TIMED_NP:
simple:
/* Normal mutex. */
- LLL_MUTEX_LOCK (mutex->__data.__lock);
+ LLL_MUTEX_LOCK (mutex->__data.__lock, id);
break;
case PTHREAD_MUTEX_ADAPTIVE_NP:
if (! __is_smp)
goto simple;
- if (LLL_MUTEX_TRYLOCK (mutex->__data.__lock) != 0)
+ if (LLL_MUTEX_TRYLOCK (mutex->__data.__lock, id) != 0)
{
int cnt = 0;
int max_cnt = MIN (MAX_ADAPTIVE_COUNT,
@@ -89,7 +104,7 @@
{
if (cnt++ >= max_cnt)
{
- LLL_MUTEX_LOCK (mutex->__data.__lock);
+ LLL_MUTEX_LOCK (mutex->__data.__lock, id);
break;
}
@@ -97,7 +112,7 @@
BUSY_WAIT_NOP;
#endif
}
- while (LLL_MUTEX_TRYLOCK (mutex->__data.__lock) != 0);
+ while (LLL_MUTEX_TRYLOCK (mutex->__data.__lock, id) != 0);
mutex->__data.__spins += (cnt - mutex->__data.__spins) / 8;
}
@@ -112,6 +127,14 @@
#endif
return 0;
+
+ out_err:
+ /* owner dead or not recoverable */
+ if (__builtin_expect (EOWNERDEAD == result || ENOTRECOVERABLE ==
result, 0))
+ if (! is_mutex_robust (mutex)) /* non-robust mutex */
+ pthread_mutex_lock_waiting_for_mutex_whose_owner_died_np (mutex,
(void *)-1);
+
+ return result;
}
#ifndef __pthread_mutex_lock
strong_alias (__pthread_mutex_lock, pthread_mutex_lock)
--- /dev/null Thu Apr 29 09:10:10 2004
+++
robustmutexes/rtnptl/src/nptl/pthread_mutex_lock_waiting_for_mutex_whose
_owner_died_np.c Tue Mar 30 09:20:22 2004
@@ -0,0 +1,26 @@
+/*
+ * (C) 2003 Intel Corporation
+ * Boris Hu <boris.hu@intel.com>
+ *
+ * (C) 2003 Intel Corporation Boris Hu <boris.hu@intel.com>
+ *
+ * Distributed under the FSF's LGPL license, v2 or later. */
+
+
+#include <pthreadP.h>
+#include <errno.h>
+#include <time.h>
+
+int
+pthread_mutex_lock_waiting_for_mutex_whose_owner_died_np
(pthread_mutex_t *__mutex,
+ const struct timespec *__reltime)
+{
+ /* Hang to tell the position when the owner of the lock is dead
+ * for non-RM lock. */
+ if ((void *)-1 == __reltime)
+ while (1) ;
+ else
+ nanosleep(__reltime, NULL);
+
+ return ETIMEDOUT;
+}
--- /dev/null Thu Apr 29 09:10:10 2004
+++ robustmutexes/rtnptl/src/nptl/pthread_mutex_setconsistency_np.c
Tue Mar 30 09:20:22 2004
@@ -0,0 +1,25 @@
+/*
+ * (C) 2002-2003 Intel Corporation
+ * Bing Wei Liu <bing.wei.liu@intel.com>.
+ *
+ * Reimplement to sync with fusyn and POSIX spec.
+ * (C) 2003 Intel Corporation Boris Hu <boris.hu@intel.com>
+ *
+ * Distributed under the FSF's LGPL license, v2 or later. */
+
+#include <errno.h>
+#include "pthreadP.h"
+
+int
+pthread_mutex_setconsistency_np(mutex, state)
+ pthread_mutex_t *mutex;
+ int state;
+{
+ int result = 0;
+
+ if (state < 0 || state > PTHREAD_MUTEX_ROBUST_DEADOWNER_NP)
+ return EINVAL;
+
+ result = lll_rtmutex_set_consistency (mutex->__data.__lock, state);
+ return 0;
+}
--- /dev/null Thu Apr 29 09:10:10 2004
+++ robustmutexes/rtnptl/src/nptl/pthread_mutex_setfast_np.c Tue Mar
30 09:20:22 2004
@@ -0,0 +1,26 @@
+/*
+ * (C) 2003 Intel Corporation
+ * Boris Hu <boris.hu@intel.com>
+ *
+ * Distributed under the FSF's LGPL license, v2 or later. */
+
+
+#include <pthreadP.h>
+#include <errno.h>
+
+int
+pthread_mutex_setfast_np (pthread_mutex_t *mutex,
+ int fast_mode)
+{
+ int errno = EINVAL;
+
+ if (PTHREAD_MUTEX_FASTPATH_NP != fast_mode && PTHREAD_MUTEX_KCO_NP !=
fast_mode)
+ return errno;
+
+ if (fast_mode == PTHREAD_MUTEX_FASTPATH_NP)
+ mutex->__data.__kind |= FULOCK_FASTPATH_MODE;
+ else
+ mutex->__data.__kind &= ~FULOCK_FASTPATH_MODE;
+
+ return 0;
+}
Boris Hu (Hu Jiangtao)
Software Engineer@ICSL
86-021-5257-4545#1277
iNET: 8-752-1277
************************************
There are my thoughts, not my employer's.
************************************
"gpg --recv-keys --keyserver wwwkeys.pgp.net 0FD7685F"
{0FD7685F:CFD6 6F5C A2CB 7881 725B CEA0 956F 9F14 0FD7 685F}