forked from mirror/ants
Auto stash before merge of "develop" and "origin/develop"
This commit is contained in:
parent
cb7070eb8c
commit
ce8f31e051
|
@ -34,8 +34,8 @@ import (
|
||||||
var sum int32
|
var sum int32
|
||||||
|
|
||||||
func myFunc(i interface{}) error {
|
func myFunc(i interface{}) error {
|
||||||
n := i.(int)
|
n := i.(int32)
|
||||||
atomic.AddInt32(&sum, int32(n))
|
atomic.AddInt32(&sum, n)
|
||||||
fmt.Printf("run with %d\n", n)
|
fmt.Printf("run with %d\n", n)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ func main() {
|
||||||
// submit tasks
|
// submit tasks
|
||||||
for i := 0; i < runTimes; i++ {
|
for i := 0; i < runTimes; i++ {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
p.Serve(i)
|
p.Serve(int32(i))
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
fmt.Printf("running goroutines: %d\n", p.Running())
|
fmt.Printf("running goroutines: %d\n", p.Running())
|
||||||
|
|
Loading…
Reference in New Issue