3da Subj : Re: double-checked locking in C To : comp.programming.threads From : Alexander Terekhov Date : Thu Jul 07 2005 08:28 pm Joe Seigh wrote: [...] > > "The behavior of pthread_once() is undefined if once_control has > > automatic storage duration or is not initialized by > > PTHREAD_ONCE_INIT." > > > So what kind of value could PTHREAD_ONCE_INIT have that couldn't be > memcpy'd from an initialized pthread_once_t object never otherwise > used? Same magic stuff as PTHREAD_MUTEX_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). > > > If C had exceptions. In C/POSIX terms, throw()-nothing means no "shall fail" errors, only "may fail" (if any). regards, alexander. . 0