Commit 4f2585be authored by 张振华's avatar 张振华

update

parents c35cb214 8d74342f
...@@ -110,7 +110,6 @@ func test() { ...@@ -110,7 +110,6 @@ func test() {
} }
func TestParallel(t *testing.T) { func TestParallel(t *testing.T) {
f1 := test f1 := test
f1() f1()
...@@ -122,10 +121,11 @@ func TestParallel(t *testing.T) { ...@@ -122,10 +121,11 @@ func TestParallel(t *testing.T) {
goSum = 0 goSum = 0
goSumMutex.Unlock() goSumMutex.Unlock()
Parallel(f1, f2)
goSumMutex.Lock() Parallel(f1, f2)
assert.True(t, goSum == 2) goSumMutex.Lock()
goSumMutex.Unlock() assert.True(t, goSum == 2)
goSumMutex.Unlock()
*/ */
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment