Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762914AbZANPCB (ORCPT ); Wed, 14 Jan 2009 10:02:01 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760781AbZANPBr (ORCPT ); Wed, 14 Jan 2009 10:01:47 -0500 Received: from cet.com.ru ([195.178.208.66]:44749 "EHLO tservice.net.ru" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1760280AbZANPBq (ORCPT ); Wed, 14 Jan 2009 10:01:46 -0500 Date: Wed, 14 Jan 2009 18:01:44 +0300 From: Evgeniy Polyakov To: Frederik Deweerdt Cc: Greg KH , linux-kernel@vger.kernel.org, dst@ioremap.net Subject: Re: [4/7] dst: thread pool. Message-ID: <20090114150144.GA6419@ioremap.net> References: <1231887933-17843-1-git-send-email-zbr@ioremap.net> <1231887933-17843-2-git-send-email-zbr@ioremap.net> <1231887933-17843-3-git-send-email-zbr@ioremap.net> <1231887933-17843-4-git-send-email-zbr@ioremap.net> <1231887933-17843-5-git-send-email-zbr@ioremap.net> <20090114144602.GG10720@gambetta> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090114144602.GG10720@gambetta> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1173 Lines: 31 Hi Frederik. Thanks for the comment! On Wed, Jan 14, 2009 at 03:46:02PM +0100, Frederik Deweerdt (frederik.deweerdt@xprog.eu) wrote: > On Wed, Jan 14, 2009 at 02:05:30AM +0300, Evgeniy Polyakov wrote: > [...] > > +void thread_pool_del_worker(struct thread_pool *p) > > +{ > > + struct thread_pool_worker *w = NULL; > > + > > + while (!w) { > > + wait_event(p->wait, !list_empty(&p->ready_list) || !p->thread_num); > ^^^^^^^^^^^^^^ > What's the purpose of !p->thread_num here? Is there an exit case missing > in the loop below? It is needed if thread was not in the ready_list but existed because of some global flag. Current code does not use simultaneous exit and this function is entered only when there are threads in the pool, so it should be correct. But if called by several threads, it should be an exit condition. I will put it into the loop termination check for the completeness. -- Evgeniy Polyakov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/