]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Staging: DST: extend thread pool exit conditions.
authorEvgeniy Polyakov <zbr@ioremap.net>
Mon, 19 Jan 2009 17:20:35 +0000 (20:20 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Apr 2009 21:53:33 +0000 (14:53 -0700)
Added thread pool exit condition into the thread_pool_del_worker(). If
called in parallel another thread can steal

Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/dst/thread_pool.c

index c35754d5ec6d433006df335a5e8d4c8e11b05bb8..7bed4e851029bff19c570a3d4a198d69f6490281 100644 (file)
@@ -115,7 +115,7 @@ void thread_pool_del_worker(struct thread_pool *p)
 {
        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",