示例#1
0
func BenchmarkForward(b *testing.B) {
	for i := 0; i < b.N; i++ {
		var b, f Barrier
		b.Forward(&f)
		go b.Fall()
		<-f.Barrier()
	}
}
示例#2
0
func BenchmarkForward2(b *testing.B) {
	for i := 0; i < b.N; i++ {
		var b, f, g Barrier
		b.Forward(&f)
		f.Forward(&g)
		go b.Fall()
		<-g.Barrier()
	}
}