func (r *LockedRand) Intn(n int) int {
	r.mu.Lock()
	v := r.rand.Intn(n)
	r.mu.Unlock()
	return v
}
Intn calls r.Rand.Intn and is safe for concurrent use.
package randutil
import (
	"math/rand"
	"sync"
)
type LockedRand struct {
	mu   *sync.Mutex
	rand *rand.Rand
}
func (r *LockedRand) Read(b []byte) (int, error) {
	r.mu.Lock()
	n, err := r.rand.Read(b)
	r.mu.Unlock()
	return n, err
}
func (r *LockedRand) Int31() int32 {
	r.mu.Lock()
	v := r.rand.Int31()
	r.mu.Unlock()
	return v
}
func (r *LockedRand) Int63() int64 {
	r.mu.Lock()
	v := r.rand.Int63()
	r.mu.Unlock()
	return v
}