func (s *Stack) IsEmpty() bool {
	return len(s.s) == 0
}
IsEmpty returns true if stack is empty.
package loop
import (
	"errors"
	"sync"
)
var ErrEmptyStack = errors.New("error: empty stack")
type Stack struct {
	sync.Mutex
	s []*Info
}
func NewStack() *Stack {
	return &Stack{s: []*Info{}}
}
func (s *Stack) Push(i *Info) {
	s.Lock()
	defer s.Unlock()
	s.s = append(s.s, i)
}
func (s *Stack) Pop() (*Info, error) {
	s.Lock()
	defer s.Unlock()
	size := len(s.s)
	if size == 0 {
		return nil, ErrEmptyStack
	}
	l := s.s[size-1]
	s.s = s.s[:size-1]
	return l, nil
}