Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Mar 2016 14:11:37 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r297064 - stable/10/sys/kern
Message-ID:  <201603201411.u2KEBb63039838@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Mar 20 14:11:37 2016
New Revision: 297064
URL: https://svnweb.freebsd.org/changeset/base/297064

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

Modified:
  stable/10/sys/kern/subr_taskqueue.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/subr_taskqueue.c
==============================================================================
--- stable/10/sys/kern/subr_taskqueue.c	Sun Mar 20 14:06:27 2016	(r297063)
+++ stable/10/sys/kern/subr_taskqueue.c	Sun Mar 20 14:11:37 2016	(r297064)
@@ -69,7 +69,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)
 
@@ -222,8 +221,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);
 }
@@ -309,10 +306,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?201603201411.u2KEBb63039838>