func (s *Select) Wait(intr rh.Intr) (clause int, commit string, err error) {
	s.ErrorFile.Clear()
	// obtain operation lock
	u := s.back.Lock(intr)
	if u == nil {
		s.ErrorFile.Set("wait interrupted")
		return -1, "", rh.ErrIntr
	}
	defer u.Unlock()
	//
	if s.back.result != nil { // wait already unblocked
		return s.back.result.Return()
	}
	if s.back.unblock == nil {
		s.ErrorFile.Set("no selection in progress")
		return -1, "", rh.ErrClash
	}
	//
	select {
	case s.back.result = <-s.back.unblock:
		s.abort() // stop all other waiters
		s.plant()
		return s.back.result.Return()
	case <-intr:
		s.ErrorFile.Set("wait interrupted")
		return -1, "", rh.ErrIntr
	}
}
// Wait returns when one of the wait files opens (with or without a POSIX open error).
// The error returned by Wait is non-nil only in the case of an interruption or another system error.
Wait returns when one of the wait files opens (with or without a POSIX open error).
The error returned by Wait is non-nil only in the case of an interruption or another system error.
// Wait returns when one of the wait files opens ( with or without a POSIX open error ) . // The error returned by Wait is non - nil only in the case of an interruption or another system error .
func (s *Select) Wait(intr rh.Intr) (clause int, commit string, err error) {
	s.ErrorFile.Clear()
	u := s.back.Lock(intr)
	if u == nil {
		s.ErrorFile.Set("wait interrupted")
		return -1, "", rh.ErrIntr
	}
	defer u.Unlock()
	if s.back.result != nil {  wait already unblocked
		return s.back.result.Return()
	}
	if s.back.unblock == nil {
		s.ErrorFile.Set("no selection in progress")
		return -1, "", rh.ErrClash
	}
	select {
	case s.back.result = <-s.back.unblock:
		s.abort()  stop all other waiters
		s.plant()
		return s.back.result.Return()
	case <-intr:
		s.ErrorFile.Set("wait interrupted")
		return -1, "", rh.ErrIntr
	}
}
func ( s * Select ) Wait ( intr rh . Intr ) ( clause int , commit string , err error ) { s . ErrorFile . Clear ( ) u := s . back . Lock ( intr ) if u == nil { s . ErrorFile . Set ( " " ) return - 1 , " " , rh . ErrIntr } defer u . Unlock ( ) if s . back . result != nil { return s . back . result . Return ( ) } if s . back . unblock == nil { s . ErrorFile . Set ( " " ) return - 1 , " " , rh . ErrClash } select { case s . back . result = <- s . back . unblock : s . abort ( ) s . plant ( ) return s . back . result . Return ( ) case <- intr : s . ErrorFile . Set ( " " ) return - 1 , " " , rh . ErrIntr } }
Wait returns when one of the wait files opens (with or without a POSIX open error).
Wait returns when one of the wait files opens ( with or without a POSIX open error ) .
// obtain operation lock // // wait already unblocked // // stop all other waiters