Subj : Re: double-checked locking in C To : comp.programming.threads From : Alexander Terekhov Date : Thu Jul 07 2005 07:33 pm Joe Seigh wrote: [...] > memcpy() of a static pthread_once_t initialized with PTHREAD_ONCE_INIT > for pthread_once_init(). Undefined behavior (as soon as you call pthread_once() on a "cloned" thing). Because pthread_once_t is noncopyable, just like any other synchronization objects. "The behavior of pthread_once() is undefined if once_control has automatic storage duration or is not initialized by PTHREAD_ONCE_INIT." > I don't even know what pthread_once_reset() even means. Effect is the same as pthread_once_destroy()+pthread_once_init() (with pthread_once_destroy() invoking optional destructor function) except that it is throw()-nothing operation (vs pthread_once_init() that can throw). regards, alexander. .