code: func (h *Heap) Pop() (interface{}, error) {
  	h.lock.Lock()
  	defer h.lock.Unlock()
  	for len(h.data.queue) == 0 {
  		// When the queue is empty, invocation of Pop() is blocked until new item is enqueued.
  		// When Close() is called, the h.closed is set and the condition is broadcast,
  		// which causes this loop to continue and return from the Pop().
  		if h.closed {
  			return nil, fmt.Errorf("heap is closed")
  		}
  		h.cond.Wait()
  	}
  	obj := heap.Pop(h.data)
  	if obj != nil {
  		return obj, nil
  	} else {
  		return nil, fmt.Errorf("object was removed from heap data")
  	}
  }
docs: // Pop waits until an item is ready. If multiple items are
  // ready, they are returned in the order given by Heap.data.lessFunc.