Golang C.lua_yield类(方法)实例源码

下面列出了Golang C.lua_yield 类(方法)源码代码实例,从而了解它的用法。

作者:rdlaitil    项目:lea   
// Yields a coroutine.
//
// This function should only be called as the return expression of a Go
// function, as follows:
// 	return s.Yield(nresults)
//
// When a Go function calls Yield in that way, the running coroutine
// suspends its execution, and the call to Resume that started this coroutine
// returns. The parameter nresults is the number of values from the stack
// that are passed as results to Resume.
func (this *State) Yield(nresults int) int {
	return int(C.lua_yield(this.luastate, C.int(nresults)))
}

作者:szl    项目:golu   
// lua_yield
func (L *State) Yield(nresults int) int {
	return int(C.lua_yield(L.s, C.int(nresults)))
}

作者:halturi    项目:luaji   
// Yields a coroutine.
//
// This function should only be called as the return expression of a Go
// function, as follows:
// 	return s.Yield(nresults)
//
// When a Go function calls Yield in that way, the running coroutine
// suspends its execution, and the call to Resume that started this coroutine
// returns. The parameter nresults is the number of values from the stack
// that are passed as results to Resume.
func (s *State) Yield(nresults int) int {
	return int(C.lua_yield(s.l, C.int(nresults)))
}


问题


面经


文章

微信
公众号

扫码关注公众号