From b550e5b2c6c2e8003e1437bfb06f3118964e987e Mon Sep 17 00:00:00 2001 From: Cole Brown Date: Fri, 15 Jun 2018 17:35:47 -0400 Subject: [PATCH] Mutex hat pattern --- addr_manager_ds.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addr_manager_ds.go b/addr_manager_ds.go index cfe979f..7cb0b60 100644 --- a/addr_manager_ds.go +++ b/addr_manager_ds.go @@ -207,10 +207,11 @@ type ttlentry struct { type ttlmanager struct { sync.RWMutex entries map[ds.Key]*ttlentry - ctx context.Context - cancel context.CancelFunc - ticker *time.Ticker - ds ds.Datastore + + ctx context.Context + cancel context.CancelFunc + ticker *time.Ticker + ds ds.Datastore } func newTTLManager(parent context.Context, d ds.Datastore, tick time.Duration) *ttlmanager {