Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Oct 2013 09:48:23 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256612 - head/sys/kern
Message-ID:  <201310160948.r9G9mN4n016173@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Oct 16 09:48:23 2013
New Revision: 256612
URL: http://svnweb.freebsd.org/changeset/base/256612

Log:
  MFprojects/camlock r254685:
  Remove TQ_FLAGS_PENDING flag, softly duplicating queue emptiness status.

Modified:
  head/sys/kern/subr_taskqueue.c

Modified: head/sys/kern/subr_taskqueue.c
==============================================================================
--- head/sys/kern/subr_taskqueue.c	Wed Oct 16 09:40:00 2013	(r256611)
+++ head/sys/kern/subr_taskqueue.c	Wed Oct 16 09:48:23 2013	(r256612)
@@ -70,7 +70,6 @@ struct taskqueue {
 
 #define	TQ_FLAGS_ACTIVE		(1 << 0)
 #define	TQ_FLAGS_BLOCKED	(1 << 1)
-#define	TQ_FLAGS_PENDING	(1 << 2)
 
 #define	DT_CALLOUT_ARMED	(1 << 0)
 
@@ -223,8 +222,6 @@ taskqueue_enqueue_locked(struct taskqueu
 	task->ta_pending = 1;
 	if ((queue->tq_flags & TQ_FLAGS_BLOCKED) == 0)
 		queue->tq_enqueue(queue->tq_context);
-	else
-		queue->tq_flags |= TQ_FLAGS_PENDING;
 
 	return (0);
 }
@@ -301,10 +298,8 @@ taskqueue_unblock(struct taskqueue *queu
 
 	TQ_LOCK(queue);
 	queue->tq_flags &= ~TQ_FLAGS_BLOCKED;
-	if (queue->tq_flags & TQ_FLAGS_PENDING) {
-		queue->tq_flags &= ~TQ_FLAGS_PENDING;
+	if (!STAILQ_EMPTY(&queue->tq_queue))
 		queue->tq_enqueue(queue->tq_context);
-	}
 	TQ_UNLOCK(queue);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310160948.r9G9mN4n016173>