ping [PATCH] Fix a deadlock bug in static variable initialization in libsupc++
Doug Kwan (關振德)
dougkwan@google.com
Thu Aug 2 20:56:00 GMT 2007
Hi,
I have sent this out in June. Could someone please review this?
This patch fixes a deadlock problem in function scope static variable.
The current code there uses a big mutex for locking everything and the
mutex is acquired throughout the whole time a variable is being
initialized. If the initalization code spawns and waits for another
another thread which needs to initialize another static variable, a
deadlock will result. My fix is to use a bit per object for locking.
The bit is only accessed when the global mutex is acquired. The mutex
is held only briefly.
Thanks.
-Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ChangeLog-gcc
Type: application/octet-stream
Size: 1650 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20070802/0bee3499/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diffs-2007.06.18
Type: application/octet-stream
Size: 27614 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20070802/0bee3499/attachment-0001.obj>
More information about the Libstdc++
mailing list