Re: [AD] Patch to fix race condition

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2010-02-28, Trent Gamblin <trent@xxxxxxxxxx> wrote:
> On Sun, February 28, 2010 8:02 pm, Thomas Fjellstrom said:
> > I must have missed it, but what exactly is the reason tls can't be setup
> > before ANYTHING else is done in al_init?
> 
> I don't know the answer to that, but this patch doesn't quite work either.
> al_fopen_stdio calls al_set_errno which again calls tls_get. If I remove the
> calls to al_set_errno from al_fopen_stdio it works... but that is not a good
> solution either, unless we create a private function just for this specific
> purpose

I see.  There are al_set_errno calls elsewhere though.

> (unless as Thomas says TLS can be initialized earlier and we avoid
> the whole mess).

Would calling pthreads_thread_init in _al_pthreads_tls_init help?
(just from browsing the code, mind you)

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/