mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
parent
41d07706ae
commit
9a14d2fb14
@ -37,6 +37,8 @@ func New() *Thread {
|
|||||||
// Loop starts the thread loop.
|
// Loop starts the thread loop.
|
||||||
//
|
//
|
||||||
// Loop must be called on the thread.
|
// Loop must be called on the thread.
|
||||||
|
//
|
||||||
|
// Loop can be called multiple times.
|
||||||
func (t *Thread) Loop(context context.Context) {
|
func (t *Thread) Loop(context context.Context) {
|
||||||
loop:
|
loop:
|
||||||
for {
|
for {
|
||||||
@ -53,7 +55,7 @@ loop:
|
|||||||
//
|
//
|
||||||
// Do not call this from the same thread. This would block forever.
|
// Do not call this from the same thread. This would block forever.
|
||||||
//
|
//
|
||||||
// Call panics when Loop already ends.
|
// Call blocks if Loop is not called.
|
||||||
func (t *Thread) Call(f func() error) error {
|
func (t *Thread) Call(f func() error) error {
|
||||||
t.funcs <- f
|
t.funcs <- f
|
||||||
return <-t.results
|
return <-t.results
|
||||||
|
Loading…
Reference in New Issue
Block a user