From d90a2f5b8998f9063ff8aa7ae0fb301e3933f709 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Fri, 25 Mar 2011 11:10:29 +0100 Subject: References are protected by rwlock instead of mutex The timeout variant of the list:set type must reference the member sets. However, its garbage collector runs at timer interrupt so the mutex protection of the references is a no go. Therefore the reference protection is converted to rwlock. --- tests/setlist.t | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/setlist.t b/tests/setlist.t index 6d9371d..a322cd4 100644 --- a/tests/setlist.t +++ b/tests/setlist.t @@ -70,6 +70,16 @@ 0 ipset del test a # Check reference number of deleted set 0 ref=`ipset list a | grep References | sed 's/References: //'` && test $ref -eq 0 +# Add element to set a +0 ipset add a 1.1.1.1 +# Swap sets +0 ipset swap a b +# Check reference number of deleted set +0 ref=`ipset list a | grep References | sed 's/References: //'` && test $ref -eq 0 +# Check reference number of member set +0 ref=`ipset list b | grep References | sed 's/References: //'` && test $ref -eq 1 +# Check element in member set +0 ipset test b 1.1.1.1 # Sleep 10s so that entries can time out 0 sleep 10 # Check reference numbers of the sets -- cgit v1.2.3