func New(n uint) *Imp { // if n < 2 { return nil } x := new(Imp) x.involved = n x.mutex = sem.New(1) x.s = sem.New(0) return x }
func New(n uint) *Imp { // x := new(Imp) x.val = int(n) for i := 0; i < M; i++ { x.b[i] = sem.New(0) } return x }
func NewNaiv(n uint) *ImpNaiv { // return &ImpNaiv{p: uint32(n), s: sem.New(n)} }
func NewSem() *ImpSem { // return &ImpSem{mutex: sem.New(1), rw: sem.New(1)} }