Summary: POSIX monitor attribute not being used
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: patch
          Severity: normal
          Priority: P2
         Component: druntime

--- Comment #0 from Leandro Lucarella <> 2010-06-22 20:07:53 
PDT ---
This is basically the same bug reported to Tango:

And then to druntime bug tracker:

But I guess druntime bugs belongs here instead. So, here it goes:

In monitor.c, the POSIX version of _STI_monitor_staticctor() is creating a
pthread_mutexattr_t but when init()ializing the actual mutex, the attribute is
not passed.

I guess this is an error, since there is no point on creating a mutexattr and
not using it.

Here is the simple patch:

--- a/monitor.c
+++ b/monitor.c
@@ -144,7 +144,7 @@ void _STI_monitor_staticctor()
         pthread_mutexattr_settype(&_monitors_attr, PTHREAD_MUTEX_RECURSIVE);
-        pthread_mutex_init(&_monitor_critsec, 0);
+        pthread_mutex_init(&_monitor_critsec, &_monitors_attr);
         inited = 1;


Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to