[igt-dev] [PATCH i-g-t v21 09/35] lib/intel_allocator: Try to stop smoothly instead of deinit

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Mar 8 07:25:37 UTC 2021


On Fri, Mar 05, 2021 at 02:16:41PM +0000, Chris Wilson wrote:

> > +               /* Thread has stuck somewhere */
> > +               if (READ_ONCE(allocator_thread_running)) {
> > +                       /* Deinit, this should stop all blocked syscalls, if any */
> > +                       channel->deinit(channel);
> > +                       pthread_join(allocator_thread, NULL);
> > +               } else {
> > +                       pthread_join(allocator_thread, NULL);
> > +                       channel->deinit(channel);
> 
> If the allocator thread was known to not be running, wouldn't it be safe
> to call channel->deinit() anyway?
> -Chris

You're right, we can safely call deinit(). Order is important only 
for first case.

--
Zbigniew


More information about the igt-dev mailing list