[Mesa-dev] [PATCH v3 05/10] formats: Use a hash table for _mesa_format_from_array_format

Matt Turner mattst88 at gmail.com
Tue Jan 13 22:02:00 PST 2015


On Tue, Jan 13, 2015 at 9:45 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Tue, Jan 13, 2015 at 8:43 PM, Matt Turner <mattst88 at gmail.com> wrote:
>> But, it sounded like what you wanted was for subsequent calls to
>> format_array_format_table_init() via call_once() to block until the
>> first had completed. I don't think call_once() does that.
>> pthread_once() doesn't, at least.
>
>
> If it doesn't guarantee that, then what use is it?  From the pthread_once
> man page:
>
> The first call to pthread_once() by any thread in a process, with a given
> once_control, shall call the init_routine with no arguments. Subsequent
> calls of pthread_once() with the same once_control shall not call the
> init_routine.  On return from pthread_once(), init_routine shall have
> completed.
>
> Sounds to mee like it guarantees that, regardless of the thread, the
> function will have been called by someone by the time your call to
> pthread_once completes.

Ah, you're right. I must have misread. Cool.


More information about the mesa-dev mailing list