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

Jan Vesely jano.vesely at gmail.com
Wed Oct 7 22:44:58 PDT 2015


On Tue, 2015-10-06 at 10:38 -0700, Ian Romanick wrote:
> I had also noticed the unused parameter warning, but I had a patch
> that
> just papered over the problem.  I'm a bit annoyed that GCC didn't
> warn
> (but I guess it couldn't really) that abs_time might be used
> uninitialized.
> 
> This patch is
> 
> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

thanks, can I also bug you to push it?
I won't have commit access back until dec.

Jan

> 
> On 10/03/2015 05:19 PM, Jan Vesely 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)
> >  {
> >      struct timespec abs_time;
> >      int rt;
> > +
> >      assert(mtx != NULL);
> >      assert(cond != NULL);
> > +    assert(xt != NULL);
> > +
> > +    abs_time.tv_sec = xt->sec;
> > +    abs_time.tv_nsec = xt->nsec;
> > +
> >      rt = pthread_cond_timedwait(cond, mtx, &abs_time);
> >      if (rt == ETIMEDOUT)
> >          return thrd_busy;
> > 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151008/f7a7e5c3/attachment.sig>


More information about the mesa-dev mailing list