From zbr@ioremap.net Wed Jan 21 09:07:00 2009 From: Evgeniy Polyakov Date: Mon, 19 Jan 2009 20:20:35 +0300 Subject: Staging: DST: extend thread pool exit conditions. To: greg@kroah.com Message-ID: <1232385638-13643-1-git-send-email-zbr@ioremap.net> Added thread pool exit condition into the thread_pool_del_worker(). If called in parallel another thread can steal Signed-off-by: Evgeniy Polyakov Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dst/thread_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/dst/thread_pool.c +++ b/drivers/staging/dst/thread_pool.c @@ -115,7 +115,7 @@ void thread_pool_del_worker(struct threa { struct thread_pool_worker *w = NULL; - while (!w) { + while (!w && p->thread_num) { wait_event(p->wait, !list_empty(&p->ready_list) || !p->thread_num); dprintk("%s: locking list_empty: %d, thread_num: %d.\n",