diff options
author | Emilio G. Cota <cota@braap.org> | 2018-08-19 05:13:33 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-08-23 18:46:25 +0200 |
commit | dbf8862a39f3099004366f1bd66d534b1590a34f (patch) | |
tree | ec90417c2c2dc623674056e9498b25adfa29b81d /tests/test-rcu-list.c | |
parent | 90487e455bc605a10b885df9aefd9c2174e5f106 (diff) | |
download | qemu-dbf8862a39f3099004366f1bd66d534b1590a34f.zip qemu-dbf8862a39f3099004366f1bd66d534b1590a34f.tar.gz qemu-dbf8862a39f3099004366f1bd66d534b1590a34f.tar.bz2 |
tests: add test-rcu-tailq
Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <20180819091335.22863-10-cota@braap.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/test-rcu-list.c')
-rw-r--r-- | tests/test-rcu-list.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c index 0ff79dc..192bfbf 100644 --- a/tests/test-rcu-list.c +++ b/tests/test-rcu-list.c @@ -91,6 +91,8 @@ struct list_element { QLIST_ENTRY(list_element) entry; #elif TEST_LIST_TYPE == 2 QSIMPLEQ_ENTRY(list_element) entry; +#elif TEST_LIST_TYPE == 3 + QTAILQ_ENTRY(list_element) entry; #else #error Invalid TEST_LIST_TYPE #endif @@ -129,6 +131,19 @@ static QSIMPLEQ_HEAD(, list_element) Q_list_head = #define TEST_LIST_INSERT_HEAD_RCU QSIMPLEQ_INSERT_HEAD_RCU #define TEST_LIST_FOREACH_RCU QSIMPLEQ_FOREACH_RCU #define TEST_LIST_FOREACH_SAFE_RCU QSIMPLEQ_FOREACH_SAFE_RCU + +#elif TEST_LIST_TYPE == 3 +static QTAILQ_HEAD(, list_element) Q_list_head; + +#define TEST_NAME "qtailq" +#define TEST_LIST_REMOVE_RCU(el, f) QTAILQ_REMOVE_RCU(&Q_list_head, el, f) + +#define TEST_LIST_INSERT_AFTER_RCU(list_el, el, f) \ + QTAILQ_INSERT_AFTER_RCU(&Q_list_head, list_el, el, f) + +#define TEST_LIST_INSERT_HEAD_RCU QTAILQ_INSERT_HEAD_RCU +#define TEST_LIST_FOREACH_RCU QTAILQ_FOREACH_RCU +#define TEST_LIST_FOREACH_SAFE_RCU QTAILQ_FOREACH_SAFE_RCU #else #error Invalid TEST_LIST_TYPE #endif |