DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39833>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39833

           Summary: process locks / pthread robust mutexes
           Product: APR
           Version: HEAD
          Platform: All
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P3
         Component: APR
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


There's a typo in APR_CHECK_PTHREAD_ROBUST_SHARED_MUTEX:

--- build/apr_threads.m4        Sun Jun 18 12:00:00 2006
+++ build/apr_threads.m4        Sun Jun 18 12:00:00 2006
@@ -263,7 +263,7 @@
         exit(2);
     if (pthread_mutexattr_setrobust_np(&attr, PTHREAD_MUTEX_ROBUST_NP))
         exit(3);
-    if (pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT))
+    if (pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT))
         exit(4);
     if (pthread_mutex_init(&mutex, &attr))
         exit(5);
----------------------------------------------------------------------
And, on a platform that implements pthread_mutexattr_setrobust_np()
(such as Solaris), it would be nice to set pthread mutexes
as the default process lock:

--- configure.in        Sun Jun 18 12:00:00 2006
+++ configure.in        Sun Jun 18 12:00:00 2006
@@ -1637,6 +1637,8 @@
 # POSIX semaphores and cross-process pthread mutexes are not
 # used by default since they have less desirable behaviour when
 # e.g. a process holding the mutex segfaults.
+# But if the system implements pthread_mutexattr_setrobust_np(),
+# it's safe to use cross-process pthread mutexes.
 # The BEOSSEM decision doesn't require any substitutions but is
 # included here to prevent the fcntl() branch being selected
 # from the decision making.
@@ -1647,6 +1649,11 @@
             APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()]))
 APR_IFALLYES(func:semget func:semctl define:SEM_UNDO,
             APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()]))
+APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl
+             func:pthread_mutexattr_setpshared dnl
+             custom:apr_cv_mutex_robust_shared dnl
+             file:/dev/zero,
+            APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [POSIX Thread Mutexes]))
 APR_IFALLYES(header:OS.h func:create_sem, 
             APR_DECIDE(USE_BEOSSEM, [BeOS Semaphores])) 
 if test "x$apr_lock_method" != "x"; then
--- build/apr_hints.m4  Sun Jun 18 12:00:00 2006
+++ build/apr_hints.m4  Sun Jun 18 12:00:00 2006
@@ -234,7 +234,7 @@
     *-solaris2*)
        PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'`
        APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS
-D_REENTRANT])
-        APR_SETIFNULL(apr_lock_method, [USE_FCNTL_SERIALIZE])
+        APR_SETIFNULL(apr_lock_method, [USE_PROC_PTHREAD_SERIALIZE])
         # readdir64_r error handling seems broken on Solaris (at least
         # up till 2.8) -- it will return -1 at end-of-directory.
         APR_SETIFNULL(ac_cv_func_readdir64_r, [no])

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to