lkml.org 
[lkml]   [2014]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3 03/10] workqueue: async worker destruction
On Tue, May 20, 2014 at 05:46:29PM +0800, Lai Jiangshan wrote:
> /**
> + * worker_detach_from_pool() - detach the worker from the pool
> + * @worker: worker which is attached to its pool
> + * @pool: attached pool
> + *
> + * Undo the attaching which had been done in create_worker().
> + * The caller worker shouldn't access to the pool after detached
> + * except it has other reference to the pool.
> + */
> +static void worker_detach_from_pool(struct worker *worker,
> + struct worker_pool *pool)
> +{
> + struct completion *detach_completion = NULL;
> +
> + mutex_lock(&pool->manager_mutex);
> + idr_remove(&pool->worker_idr, worker->id);
> + if (idr_is_empty(&pool->worker_idr))
> + detach_completion = pool->detach_completion;
> + mutex_unlock(&pool->manager_mutex);
> +
> + if (detach_completion)
> + complete(detach_completion);
> +}

As a separate clean up, please submit a patch to remove @pool from the
above function. @worker is attached to @pool, so the argument is
redundant.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2014-05-20 17:41    [W:0.128 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site