From owner-svn-src-all@FreeBSD.ORG Mon Aug 17 08:42:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80167106568D; Mon, 17 Aug 2009 08:42:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 702088FC61; Mon, 17 Aug 2009 08:42:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7H8gYtk054779; Mon, 17 Aug 2009 08:42:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7H8gYo5054777; Mon, 17 Aug 2009 08:42:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200908170842.n7H8gYo5054777@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 17 Aug 2009 08:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196293 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2009 08:42:34 -0000 Author: pjd Date: Mon Aug 17 08:42:34 2009 New Revision: 196293 URL: http://svn.freebsd.org/changeset/base/196293 Log: Because taskqueue_run() can drop tq_mutex, we need to check if the TQ_FLAGS_ACTIVE flag wasn't removed in the meantime, which means we missed a wakeup. Approved by: re (kib) Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Mon Aug 17 08:38:41 2009 (r196292) +++ head/sys/kern/subr_taskqueue.c Mon Aug 17 08:42:34 2009 (r196293) @@ -401,6 +401,13 @@ taskqueue_thread_loop(void *arg) TQ_LOCK(tq); while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { taskqueue_run(tq); + /* + * Because taskqueue_run() can drop tq_mutex, we need to + * check if the TQ_FLAGS_ACTIVE flag wasn't removed in the + * meantime, which means we missed a wakeup. + */ + if ((tq->tq_flags & TQ_FLAGS_ACTIVE) == 0) + break; TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); }