From f49f9d84eae43e56fa9640e2dcde631699605073 Mon Sep 17 00:00:00 2001 From: David Wolinsky Date: Wed, 27 Oct 2010 14:11:23 -0400 Subject: [PATCH] [Collections] TimeBasedCache will now actually close --- src/Brunet/Collections/TimeBasedCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Brunet/Collections/TimeBasedCache.cs b/src/Brunet/Collections/TimeBasedCache.cs index b281651d9..f6e2a73d4 100644 --- a/src/Brunet/Collections/TimeBasedCache.cs +++ b/src/Brunet/Collections/TimeBasedCache.cs @@ -161,7 +161,7 @@ public bool TryGetValue(K key, out V value, out bool update) /// Must stop the Recycling thread. public void Stop() { - if(System.Threading.Interlocked.Exchange(ref _stopped, 1) == 0) { + if(System.Threading.Interlocked.Exchange(ref _stopped, 1) == 1) { return; }