Closed
Description
It appears to be testing copying a lock, which people shouldn't do.
func TestCondCopy(t *testing.T) {
defer func() {
err := recover()
if err == nil || err.(string) != "sync.Cond is copied" {
t.Fatalf("got %v, expect sync.Cond is copied", err)
}
}()
c := Cond{L: &Mutex{}}
c.Signal()
c2 := c
c2.Signal()
}
Vet doesn't like it:
sync/cond_test.go:254: assignment copies lock value to c2: sync.Cond contains sync.noCopy
Objections to it being deleted for 1.8?
cc @dvyukov
Part of dealing with #11041.