From 954871d06224d02496535cdf2703693f0cb44b88 Mon Sep 17 00:00:00 2001 From: Xargin Date: Sun, 10 Jan 2016 19:39:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E6=9C=89=E4=B8=80=E8=A1=8C=E8=8B=B1?= =?UTF-8?q?=E6=96=87=E6=B2=A1=E5=88=A0=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ch9/ch9-05.md | 1 - 1 file changed, 1 deletion(-) diff --git a/ch9/ch9-05.md b/ch9/ch9-05.md index e96f8c8..21fcb9f 100644 --- a/ch9/ch9-05.md +++ b/ch9/ch9-05.md @@ -44,7 +44,6 @@ func loadIcons() { 因此,一个goroutine在检查icons是非空时,也并不能就假设这个变量的初始化流程已经走完了(译注:可能只是塞了个空map,里面的值还没填完,也就是说填值的语句都没执行完呢)。 最简单且正确的保证所有goroutine能够观察到loadIcons效果的方式,是用一个mutex来同步检查。 -The simplest correct way to ensure that all goroutines observe the effects of loadIcons is to synchronize them using a mutex: ```go var mu sync.Mutex // guards icons