From 7d1d6d6ae935664bc8b80ab2b1fc7ab77a7e46da Mon Sep 17 00:00:00 2001 From: Patrick Mylund Nielsen Date: Thu, 8 Aug 2013 15:10:54 -0400 Subject: [PATCH] Note about needing explicit synchronization if you want to use the returned items map and its cache at the same time --- cache.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cache.go b/cache.go index 2278a1d..de300fa 100644 --- a/cache.go +++ b/cache.go @@ -936,7 +936,9 @@ func (c *cache) LoadFile(fname string) error { // Returns the items in the cache. This may include items that have expired, // but have not yet been cleaned up. If this is significant, the Expiration -// fields of the items should be checked. +// fields of the items should be checked. Note that explicit synchronization +// is needed to use a cache and its corresponding Items() return value at +// the same time, as the map is shared. func (c *cache) Items() map[string]*Item { c.RLock() defer c.RUnlock()