This section is empty.


View Source
var BreakLoop = errors.New("break loop")

BreakLoop represents an termination of the loop.


This section is empty.


type NoopThread

type NoopThread struct{}

NoopThread is used to disable threading.

func (*NoopThread) Call

func (t *NoopThread) Call(f func() error) error

Call executes the func immediately

func (*NoopThread) Loop

func (t *NoopThread) Loop()

Loop does nothing

type OSThread

type OSThread struct {
	// contains filtered or unexported fields

OSThread represents an OS thread.

func NewOSThread

func NewOSThread() *OSThread

NewOSThread creates a new thread.

It is assumed that the OS thread is fixed by runtime.LockOSThread when NewOSThread is called.

func (*OSThread) Call

func (t *OSThread) Call(f func() error) error

Call calls f on the thread.

Do not call this from the same thread. This would block forever.

If f returns BreakLoop, Loop returns.

Call blocks if Loop is not called.

func (*OSThread) Loop

func (t *OSThread) Loop()

Loop starts the thread loop until a posted function returns BreakLoop.

Loop must be called on the thread.

type Thread

type Thread interface {
	Call(func() error) error

Thread defines threading behavior in Ebiten.

func NewNoopThread

func NewNoopThread() Thread

NewNoopThread creates a new thread that does no threading.

Source Files