
21 Sep
2007
21 Sep
'07
11:23 a.m.
Anthony, Anthony Williams wrote:
POSIX provides pthread_once. We should use it. The Windows Vista functions look to supply a similar facility, and do at least allow the passing of a parameter to the routine without using TSS.
did you catch my comments on this one (elsewhere in this thread)? <cite> The pthread-based implementation seems overly simplified: It won't compile for C++ functions that are not 'extern "C"' with some compilers. Further, what about exceptions from within pthread_once? </cite> I agree that TSS is not a good alternative, however (but I don't think it's needed for an improved pthread-based implementation). Regards, Tobias