gsema
gsema copied to clipboard
Run the the example fail
i run by copy exmaple code, it print nothing. my go version: go version go1.21.5 linux/amd64 than i change func Read sema.Add(1) to main goroutine inside the for block it run well
···code: userCount := 10 for i := 0; i < userCount; i++ { fmt.Printf("go init func: %d\n",i) sema.Add(1) // move it to here go iRead(i) }
does it matter to go version