Subj : Re: pthread_once() does not update __pthread_once_pad To : comp.programming.threads From : roger.faulkner Date : Sat Jan 29 2005 09:50 pm Scott Shinault wrote: > Having a problem where pthread_once() gets called, but does not update the > __pthread_once_pad[3] to show that the init routine was called for the > associated pthread_once_t var. > > The init routine gets called, and the resultant pthread_key_t variable can > be used to call pthread_setspecific(), but a resultant pthread_getspecific() > will fail. I can see in gdb that the __pthread_once_pad[3] value is > unchanged. > > This is happening on SOlaris 9 SPARC with gcc 3.3.2, and on Solaris 8 x86. > The code works on Linux with an older gcc and also on Solaris 8 SPARC with > an older gcc. > > We can write our pthread_once() to increment the __pthread_once_pad[3] value > and call the init function and it will work fine. > > Any clues? What you say definitely cannot happen with -lpthread on Solaris. Are you linked with -lpthread? If not, then you get a dummy function from libc that does nothing. That dummy function doesn't even call the specified function. Or maybe you have interposed on pthread_once() with a version that doesn't do anything to the pthread_once_t control structure? Maybe from some library you are using? You have something wrong with your application. Look at your libraries to see who, other than libpthread, is providing pthread_*() functions for you. Stop using that library. Roger Faulkner roger.faulkner@sun.com .