1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
14 func (o
*one
) Increment() {
18 func run(once
*Once
, o
*one
, c
chan bool) {
19 once
.Do(func() { o
.Increment() })
23 func TestOnce(t
*testing
.T
) {
28 for i
:= 0; i
< N
; i
++ {
31 for i
:= 0; i
< N
; i
++ {
35 t
.Errorf("once failed: %d is not 1", *o
)