From 13a1b1e0506c956eb78f93b5601e92bc0e324bd6 Mon Sep 17 00:00:00 2001 From: Wide Jones <79801664+ZhongWwwHhh@users.noreply.github.com> Date: Mon, 9 Feb 2026 21:30:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=85=B3=E4=BA=8E=E9=94=81?= =?UTF-8?q?=E7=9A=84=E7=A4=BA=E4=BE=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 先打印当前协程修改后的值,再解锁变量 --- src/essential/senior/110.concurrency.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/essential/senior/110.concurrency.md b/src/essential/senior/110.concurrency.md index e827faef5..2c5cee524 100644 --- a/src/essential/senior/110.concurrency.md +++ b/src/essential/senior/110.concurrency.md @@ -1581,9 +1581,10 @@ func main() { ans := 1 // 修改数据 *data = temp + ans + // 打印当前协程修改后的值 + fmt.Println(*data) // 解锁 lock.Unlock() - fmt.Println(*data) wait.Done() }(&count) }