[Mesa-dev] [PATCH] glsl: Make access to type flyweight global state thread safe

Ian Romanick idr at freedesktop.org
Thu Oct 25 11:29:10 PDT 2012

On 10/25/2012 11:17 AM, Eric Anholt wrote:
> Ian Romanick <idr at freedesktop.org> writes:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>> This should fix some problems related to compiling shaders in different
>> contextes from multiple threads.
> This is pretty nasty.  I think de-rallocing this file might end up nicer
> (we'd need a destructor that frees type->name and type->fields.whatever,
> and a hash walk that calls it in _mesa_glsl_release_types and frees the
> key string), then mutexes would only be needed for the structure/array
> hash table inserts with no recursion issues.
> Does that sound reasonable?

I can try that out.  I'm waiting to hear back from the bug reporter to 
see if this even fixes his original issue.

More information about the mesa-dev mailing list