svn commit: r216149 - head/sys/sys
Konstantin Belousov
kib at FreeBSD.org
Fri Dec 3 16:07:51 UTC 2010
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.
*/
More information about the svn-src-head
mailing list