Bugzilla bug 132089: use the UNIX98 pthread_mutexattr_settype function.
authorwtc%netscape.com
Wed, 20 Mar 2002 21:06:10 +0000
changeset 2305 2b71e5da1152030f0b1683041f43cbd03c821327
parent 2304 65201a03ebf6c8c0453d00644938fc0599380bb2
child 2306 c3cd1a3e66d3b2b89f738e2f228f8324bb60e9e1
push idunknown
push userunknown
push dateunknown
bugs132089
Bugzilla bug 132089: use the UNIX98 pthread_mutexattr_settype function. Add -D_XOPEN_SOURCE=500 to enable the UNIX98 compilation environment.
pr/src/pthreads/Makefile.in
pr/src/pthreads/ptsynch.c
--- a/pr/src/pthreads/Makefile.in
+++ b/pr/src/pthreads/Makefile.in
@@ -58,13 +58,18 @@ CSRCS = \
 	$(NULL)
 
 TARGETS	= $(OBJS)
 
 INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
 DEFINES	+= -D_NSPR_BUILD_
 
+ifeq ($(OS_ARCH),Linux)
+# for pthread_mutexattr_settype
+DEFINES += -D_XOPEN_SOURCE=500
+endif
+
 include $(topsrcdir)/config/rules.mk
 
 export:: $(TARGETS)
 
 
--- a/pr/src/pthreads/ptsynch.c
+++ b/pr/src/pthreads/ptsynch.c
@@ -68,17 +68,17 @@ static pthread_t pt_zero_tid;  /* a null
 void _PR_InitLocks(void)
 {
     int rv;
     rv = _PT_PTHREAD_MUTEXATTR_INIT(&_pt_mattr); 
     PR_ASSERT(0 == rv);
 
 #ifdef LINUX
 #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
-    rv = pthread_mutexattr_setkind_np(&_pt_mattr, PTHREAD_MUTEX_ADAPTIVE_NP);
+    rv = pthread_mutexattr_settype(&_pt_mattr, PTHREAD_MUTEX_ADAPTIVE_NP);
     PR_ASSERT(0 == rv);
 #endif
 #endif
 
     rv = _PT_PTHREAD_CONDATTR_INIT(&_pt_cvar_attr);
     PR_ASSERT(0 == rv);
 }