[Mesa-dev] [PATCH 7/7] c11: Make TIME_UTC a conditional macro.

Jose Fonseca jfonseca at vmware.com
Thu Jan 23 04:48:12 PST 2014


----- Original Message -----
> On Thu, Jan 09, 2014 at 11:32:10AM -0800, Jose Fonseca wrote:
> > This series is pretty much what I proposed several months ago, rebased on
> > top of master, with minor if any tweaks.
> > 
> > Still to do is remove the deprecated abstractions (which now are mere
> > wrappers of the c11 ones).
> > 
> > That said, this series is already useful as is, not only because of
> > the code de-duplication, but also because the Windows conditional var
> > implemention in master is poll-based so performs quite badly, in
> > particular llvmpipe with many threads.  Which is fixed here.
> > 
> > IMHO the rest can be done as time permits...
> > 
> > Jose
> 
> This series looks good to me. But I'd like to see patch 7 squashed into
> patch 2 to prevent possible build failures during bisects.

Thanks for all the reviews.

I've addressed all issues that were raised during review, and I'm finally about to push this series.

> I like how this series opens up opportunities for additional cleanups.
> In particular, we can now begin to remove the threading wrappers in
> src/egl/main.
> 

Yes, I didn't had the time to go that far, but that is indeed the hope.


One remark, the bundled C11/threads.h headers provide a non-standard static mutex static initializer:

  // FIXME: temporary non-standard hack to ease transition
  #define _MTX_INITIALIZER_NP PTHREAD_MUTEX_INITIALIZER

because unfortunately C11's <threads.h> does not provide static mutex initializers.  Instead it provides "one time initialization" objects, which as a bit harder to use, but do pretty much the same thing.

This non-standard initializer is just a temporary hack -- I'm not advocating we keep this forever.  Rather, I think that when we do purge Mesa source from all threading wrappers, we should try as much as possible avoid these static mutexes, so that one day we can use system provided C11/threads.h if they ever become available.


Jose


More information about the mesa-dev mailing list