This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCHES][RFC] Fix a deadlock bug in static variable initialization
Hi
2007/6/8, Richard Guenther <richard.guenther@gmail.com>:
Care to explain the deadlock problem?
The current libstdc++-v3 uses one single global mutex to synchronize
initialization of function scope static variables. The mutex is locked
by a thread trying to initialize a static var and is held until the
initialization is finished or aborted. Since we can do arbitrary
complex initialization, one thread can spawn another thread and wait
for the newl created thread while holding the mutex. If the other
thread needs to initialize another function scope static, we will get
a deadlock. The patches include a new test at in the libstdc++-v3
testsuite.
Also the ChangeLog is formatted incorrectly (see below).
okay. Will change formating.
-Doug