[Issue 4370] New: POSIX monitor attribute not being used
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jun 22 20:07:55 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4370
Summary: POSIX monitor attribute not being used
Product: D
Version: D2
Platform: All
URL: http://dsource.org/projects/tango/ticket/1929
OS/Version: All
Status: NEW
Keywords: patch
Severity: normal
Priority: P2
Component: druntime
AssignedTo: sean at invisibleduck.org
ReportedBy: llucax at gmail.com
--- Comment #0 from Leandro Lucarella <llucax at gmail.com> 2010-06-22 20:07:53 PDT ---
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;
}
}
---
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list