[Patch] libstdc++/24244 (2nd try)
Paolo Carlini
pcarlini@suse.de
Tue Oct 11 12:02:00 GMT 2005
Hi,
so we actually have a problem with the initialization of those mutexes,
when __GTHREAD_MUTEX_INIT is defined. The fix for this, figured out by
Jonathan, is simple, in principle, because these objects are allocated
on the stack, not on the heap, and we don't need complicate "once"
logic. The only problem is that, strictly speaking, *copying* mutexes is
not allowed: hopefully, however, the below is sufficiently portable to
the targets we care of, certainly we are alredy using the same approach,
involving copies, in the initializations present in mt_allocator.cc.
I would ask Kurt to test this version of the patch, which works fine
here: I believe it represents an improvement anyway, because currently,
unfortunately, in the common case of __GTHREAD_MUTEX_INIT defined, those
mutexes are currently not initialized at all, completely unpredictable
behavior, we can't do worse.
Thanks again to Kurt for reporting this serious issue.
Paolo.
/////////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_24244
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20051011/7910bd65/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_24244
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20051011/7910bd65/attachment-0001.ksh>
More information about the Libstdc++
mailing list