From 05b6731f1f2650a285f15f264738d2cf08cf1fa3 Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Thu, 20 Jun 2013 08:11:40 -0700 Subject: [PATCH] explain gosched --- examples/atomic-counters/atomic-counters.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/atomic-counters/atomic-counters.go b/examples/atomic-counters/atomic-counters.go index 683e0ec..19ee445 100644 --- a/examples/atomic-counters/atomic-counters.go +++ b/examples/atomic-counters/atomic-counters.go @@ -29,7 +29,8 @@ func main() { // address of our `ops` counter with the // `&` syntax. atomic.AddUint64(&ops, 1) - + + // Allow other goroutines to proceed. runtime.Gosched() } }()