1
barbery OP 额。。。gist链接被转成内嵌脚本了。。。好吧,我贴下部分输出结果,如下:
intNum 100 atomicIntNum 100 mapNum map[count:93] sliNum [100] intNum 93 atomicIntNum 99 mapNum map[count:71] sliNum [100] intNum 95 atomicIntNum 100 mapNum map[count:76] sliNum [100] intNum 100 atomicIntNum 100 mapNum map[count:83] sliNum [100] |
2
wjchen 2014-10-12 17:08:43 +08:00 1
atomicIntNum = atomic.AddInt32(&atomicIntNum, 1)这里不需要赋值。
|
3
barbery OP @wjchen 果然,赞一个,看到文档写着“func AddInt32(addr *int32, delta int32) (new int32)” 返回new int32 以为需要赋值。。。原来是我搞错了~
|
6
chai2010 2014-10-20 07:25:49 +08:00 1
|