Subj : Re: Can C++ local static objects be made thread safe? To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Wed Feb 09 2005 09:26 pm "David Schwartz" writes: >> And this is not a problem: each block of initializers have a >> different pthread_once_t. There would be a deadlock only if the >> same initializer is reentered, but C++ already makes this >> undefined. > > POSIX-compliant threads code must already protect these accesses > with mutexes or the code is undefined anyway. So how does an > additional mutex help? You would have to change either the POSIX > standard or the C++ standard. Since the C++ standard doesn't say about threads, and POSIX doesn't say about C++, we are already outside their current scopes. We are talking about what a future C++ with threads, or a future POSIX with C++, should say. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .