func (u *UnboundedChan) Dequeue() Elt {
	u.adjust()
	myInd := index(atomic.AddUint64((*uint64)(&u.q.H), 1) - 1)
	cell, cellInd := myInd.SplitInd()
	seg := u.q.findCell(u.head, cell)
	elt := seg.Load(cellInd)
	wt := makeWaiter()
	if elt == nil &&
		atomic.CompareAndSwapPointer((*unsafe.Pointer)(unsafe.Pointer(&seg.Data[cellInd])),
			unsafe.Pointer(nil), unsafe.Pointer(wt)) {
		if debug {
			dbgPrint("\t[deq] slow path\n")
		}
		return wt.Recv()
	}
	return seg.Load(cellInd)
}
Dequeue an element from the channel, will block if nothing is there
package fchan
import (
	"runtime"
	"sync/atomic"
	"unsafe"
)
type UnboundedChan struct {
	q *queue
	head, tail *segment
}
func New() *UnboundedChan {
	segPtr := &segment{}  
	q := &queue{
		H:           0,
		T:           0,
		SpareAllocs: segList{MaxSpares: int64(runtime.GOMAXPROCS(0))},
	}
	h := &UnboundedChan{
		q:    q,
		head: segPtr,
		tail: segPtr,
	}
	return h
}
func (u *UnboundedChan) NewHandle() *UnboundedChan {
	return &UnboundedChan{
		q:    u.q,
		head: u.head,
		tail: u.tail,
	}
}
func (u *UnboundedChan) Enqueue(e Elt) {
	u.adjust()  
	myInd := index(atomic.AddUint64((*uint64)(&u.q.T), 1) - 1)
	cell, cellInd := myInd.SplitInd()
	seg := u.q.findCell(u.tail, cell)
	if atomic.CompareAndSwapPointer((*unsafe.Pointer)(unsafe.Pointer(&seg.Data[cellInd])),
		unsafe.Pointer(nil), unsafe.Pointer(e)) {
		return
	}
	wt := (*waiter)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&seg.Data[cellInd]))))
	wt.Send(e)
}
func (q *queue) findCell(start *segment, cellID index) *segment {
	cur := start
	for cur.ID != cellID {
		next := (*segment)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&cur.Next))))
		if next == nil {
			q.Grow(cur)
			continue
		}
		cur = next
	}
	return cur
}
func (u *UnboundedChan) adjust() {
	H := index(atomic.LoadUint64((*uint64)(&u.q.H)))
	T := index(atomic.LoadUint64((*uint64)(&u.q.T)))
	cellH, _ := H.SplitInd()
	advance(&u.head, cellH)
	cellT, _ := T.SplitInd()
	advance(&u.tail, cellT)
}