From fd3734bc4afb8f454dc599dc6d450698c499449b Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Fri, 29 Mar 2019 10:27:26 +0800 Subject: [PATCH] Fix: incorrect mutex in speedTest (#153) --- adapters/outbound/urltest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapters/outbound/urltest.go b/adapters/outbound/urltest.go index ecca07b7..6ea6dd40 100644 --- a/adapters/outbound/urltest.go +++ b/adapters/outbound/urltest.go @@ -92,7 +92,7 @@ func (u *URLTest) fallback() { } func (u *URLTest) speedTest() { - if atomic.CompareAndSwapInt32(&u.once, 0, 1) { + if !atomic.CompareAndSwapInt32(&u.once, 0, 1) { return } defer atomic.StoreInt32(&u.once, 0)