lkml.org 
[lkml]   [2014]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/10] workqueue: async worker destruction
On Wed, May 07, 2014 at 03:30:39PM +0800, Lai Jiangshan wrote:
> On 04/27/2014 12:08 PM, Lai Jiangshan wrote:
>
> >
> > spin_unlock_irq(&pool->lock);
> > +
> > + wait_event_cmd(pool->workers_unbound,
> > + idr_is_empty(&pool->worker_idr),
> > + mutex_unlock(&pool->manager_mutex),
> > + mutex_lock(&pool->manager_mutex));
> > +
>
>
> How about I wrap it as wait_event_mutex()?
> (like wait_event_lock_irq() in kernel and pthread_cond_wait() in userspace)

waitq tends to be trickier to get right. Can you please give
completion a shot? completion is pretty convenient for (its only
purpose after all) this sort of one-shot synchronizations.

--
tejun


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