Comment #0 by leandro.lucarella — 2010-06-22T20:07:53Z
This is basically the same bug reported to Tango:
http://dsource.org/projects/tango/ticket/1929
And then to druntime bug tracker:
http://www.dsource.org/projects/druntime/ticket/26
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_init(&_monitors_attr);
pthread_mutexattr_settype(&_monitors_attr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&_monitor_critsec, 0);
+ pthread_mutex_init(&_monitor_critsec, &_monitors_attr);
inited = 1;
}
}
---