Author: kib
Date: Fri Dec  3 16:07:50 2010
New Revision: 216149
URL: http://svn.freebsd.org/changeset/base/216149

Log:
  Add SLIST_SWAP() macro.
  
  MFC after:    1 week

Modified:
  head/sys/sys/queue.h

Modified: head/sys/sys/queue.h
==============================================================================
--- head/sys/sys/queue.h        Fri Dec  3 14:20:20 2010        (r216148)
+++ head/sys/sys/queue.h        Fri Dec  3 16:07:50 2010        (r216149)
@@ -213,6 +213,12 @@ struct {                                                   
        \
        SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field);   \
 } while (0)
 
+#define SLIST_SWAP(head1, head2, type) do {                            \
+       struct type *swap_first = SLIST_FIRST(head1);                   \
+       SLIST_FIRST(head1) = SLIST_FIRST(head2);                        \
+       SLIST_FIRST(head2) = swap_first;                                \
+} while (0)
+
 /*
  * Singly-linked Tail queue declarations.
  */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to