func (wg *WaitGroup) Wait() {
	spin := NewSpinner(SpinPriorityHigh)
	for wg.Active() {
		spin.Yield()
	}
}
Wait blocks until the counter is 0 or less.
package tsync
import (
	"sync/atomic"
	"time"
)
type WaitGroup struct {
	counter int32
}
func (wg *WaitGroup) Active() bool {
	return atomic.LoadInt32(&wg.counter) > 0
}
func (wg *WaitGroup) Inc() {
	atomic.AddInt32(&wg.counter, 1)
}
func (wg *WaitGroup) Add(delta int) {
	atomic.AddInt32(&wg.counter, int32(delta))
}
func (wg *WaitGroup) Done() {
	atomic.AddInt32(&wg.counter, -1)
}
func (wg *WaitGroup) Reset() {
	atomic.StoreInt32(&wg.counter, 0)
}
func (wg *WaitGroup) IncWhenDone() {
	spin := NewSpinner(SpinPriorityHigh)
	for !atomic.CompareAndSwapInt32(&wg.counter, 0, 1) {
		spin.Yield()
	}
}