Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Thu Feb 03 2005 10:23 pm Giancarlo Niccolai writes: >> Simply because the C++ standard is quite specific in that static >> function local variables (non POD) must be initialized exactly once >> on the *first time* that control passes through the variable. All >> we're doing here is enforcing this requirement. > > Perfect. So, what's the problem in having a mutex built before you > first need the thing that are willing to use that mutex? Why do a > compiler having this for you should make your program better? Because it would change various instances of code written with no threads in mind from unsafe to safe to use with threads. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .