[Mesa-dev] [PATCH] c11/threads: initialize timeout structure

Ian Romanick idr at freedesktop.org
Tue Oct 6 12:30:02 PDT 2015


On 10/06/2015 12:04 PM, Matt Turner wrote:
> On Sat, Oct 3, 2015 at 5:19 PM, Jan Vesely <jano.vesely at gmail.com> wrote:
>> Signed-off-by: Jan Vesely <jano.vesely at gmail.com>
>> ---
>>  include/c11/threads_posix.h | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h
>> index 3def6c4..ce9853b 100644
>> --- a/include/c11/threads_posix.h
>> +++ b/include/c11/threads_posix.h
>> @@ -136,8 +136,14 @@ cnd_timedwait(cnd_t *cond, mtx_t *mtx, const xtime *xt)
> 
> I'm confused. The docs here [1] give a different prototype for this
> function -- one without the xt argument. Is our implementation for
> some pre-C11 spec?

It's not without the xt argument... it's with that argument having a
different (const struct timespec* restrict time_point) type.  It looks
like mtx_timedlock (http://en.cppreference.com/w/c/thread/mtx_timedlock)
has the same issue.

As far as I can tell, C11 struct timespec
(http://en.cppreference.com/w/c/chrono/timespec) is the same as Linux
struct timespec.  POSIX
(http://pubs.opengroup.org/onlinepubs/009695399/basedefs/time.h.html)
allows it to have extra fields, but I don't think that should be a
problem.  Maybe there's a conflict on Windows?  Maybe Jose knows?

> [1] http://en.cppreference.com/w/c/thread/cnd_timedwait
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list