svn commit: r254685 - projects/camlock/sys/kern

Alexander Motin mav at FreeBSD.org
Fri Aug 23 12:07:13 UTC 2013


Author: mav
Date: Fri Aug 23 12:07:13 2013
New Revision: 254685
URL: http://svnweb.freebsd.org/changeset/base/254685

Log:
  Remove TQ_FLAGS_PENDING flag, softly duplicating queue emptiness status.

Modified:
  projects/camlock/sys/kern/subr_taskqueue.c

Modified: projects/camlock/sys/kern/subr_taskqueue.c
==============================================================================
--- projects/camlock/sys/kern/subr_taskqueue.c	Fri Aug 23 10:57:05 2013	(r254684)
+++ projects/camlock/sys/kern/subr_taskqueue.c	Fri Aug 23 12:07:13 2013	(r254685)
@@ -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);
 }
@@ -300,10 +297,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);
 }
 


More information about the svn-src-projects mailing list