示例#1
0
func loadTicks() uint64 {
	aba := atomic.LoadUintptr(&ticksABA)
	for {
		barrier.Compiler()
		t := ticks[aba&1]
		barrier.Compiler()
		aba1 := atomic.LoadUintptr(&ticksABA)
		if aba == aba1 {
			return t
		}
		aba = aba1
	}
}
示例#2
0
文件: terminal.go 项目: rjammala/emgo
func (t *terminal) waittx() {
	barrier.Compiler()
	for t.siz.tx != 0 {
		barrier.Compiler()
	}
}
示例#3
0
文件: delay.go 项目: rjammala/emgo
// Loop can be used to perform short active delay.
func Loop(n int) {
	for n > 0 {
		n--
		barrier.Compiler()
	}
}
示例#4
0
文件: terminal.go 项目: rjammala/emgo
func (t *terminal) waitrx() {
	barrier.Compiler()
	for t.siz.rx == 0 {
		barrier.Compiler()
	}
}