[igt-dev] [PATCH i-g-t] igt/sw_sync: Wrap threaded counter manipulation with mb

Chris Wilson chris at chris-wilson.co.uk
Fri Jun 15 09:07:54 UTC 2018


Quoting Chris Wilson (2018-05-03 20:40:53)
> Quoting Joonas Lahtinen (2018-05-03 17:55:57)
> > Quoting Chris Wilson (2018-05-02 12:28:07)
> > > @@ -589,11 +589,9 @@ static void * test_sync_multi_consumer_producer_thread(void *arg)
> > >                 if (sync_fence_wait(fence, 1000) < 0)
> > >                         return (void *) 1;
> > >  
> > > -               if (*(data->counter) != next_point)
> > > +               if (__sync_fetch_and_add(data->counter, 1) != next_point)
> > >                         return (void *) 1;
> > >  
> > > -               (*data->counter)++;
> > 
> > This is a behavior change, the counter gets incremented always :(
> 
> But it doesn't matter, since the return 1 here is failure. And any
> thread reporting failure is enough.

Poke.
-Chris


More information about the igt-dev mailing list