On Mon, 2009-07-13 at 23:21 -0700, Chia-I Wu wrote:
> On Mon, Jul 13, 2009 at 03:14:37PM +0100, José Fonseca wrote:
> > Your patches look good, with the exception of relying on
> > _glthread_DECLARE_STATIC_MUTEX which is broken on windows, and windows
> > too fits on the THREADS && !GLX_USE_TLS use case.
> Oops...
> > 
> > So we need to fix _glthread_DECLARE_STATIC_MUTEX on windows first, or
> > these lines should be added
> > 
> > #ifdef _WIN32
> >   /* FIXME: _glthread_DECLARE_STATIC_MUTEX is broken on windows */
> >   static int onetime = 0;
> >   if(!onetime) {
> >     _glthread_INIT_MUTEX(ThreadCheckMutex);
> >     onetime = 1;
> >   }
> > #endif
> > 
> > Which re-introduces the race condition, but at least it prevents it from
> > crashing on the first access to the ThreadCheckMutex. This until we find
> > a proper way of implementing _glthread_DECLARE_STATIC_MUTEX on windows.
> MSDN says that the behavior is undefined if a critical section is
> initialized twice.  It is better to avoid the lock completely on
> windows.  I have attached a patch for this.  Could you help me test it?
> > Michal, I recall you mentioned some way of statically initializing
> > CRITICAL_SECTIONs on windows, but I can't find anything on it on google.
> > The only ways I can find are either using atomic operations on a flag,
> > or using constructors/DLL_PROCESS_ATTACH etc.

Sorry for the delay. I attempted to test this, but your patches are
pasted inline in the email body, and I don't know an easy way to extract
them from evolution without copying and pasting manually. 

Anyway, it looks perfect. If there is any regression I'll quickly fix
it.

I'll try to find a way to fix _glthread_DECLARE_STATIC_MUTEX when I find
some time. 

Jose


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to