This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: incorrect usage of cancellable nanosleep() in __pthread_acquire() ?


On Wednesday 25 October 2006 22:22, Atsushi Nemoto wrote:
> On Wed, 25 Oct 2006 06:11:39 -0400, Mike Frysinger <vapier@gentoo.org> 
wrote:
> > perhaps this would even be too much:
> >  } else {
> > +	pthread_descr self = thread_self();
> > +	int oldstate = THREAD_GETMEM(self, p_cancelstate);
> > +	THREAD_SETMEM(self, p_cancelstate, PTHREAD_CANCEL_DISABLE);
> >  	tm.tv_sec = 0;
> >  	tm.tv_nsec = SPIN_SLEEP_DURATION;
> >  	nanosleep(&tm, NULL);
> > +	THREAD_SETMEM(self, p_cancelstate, PTHREAD_CANCEL_ENABLE);
> >  	cnt = 0;
> >  }
>
> There is a bug report (and a patch) about this issue in Debian BTS:
>
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=342574

ah i do like that version much better :)
-mike

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]