On Sat, Jan 7, 2017 at 2:12 AM tsuna <tsuna...@gmail.com> wrote:

> Is there a better way?

Is fn allowed to mutate the map? If not then the locking/unlocking is not
necessary at all. If yes then there's a race between acquiring the k,v pair
from the map under a lock and calling fn with those, now possibly obsolete
values.


-- 

-j

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to