thread

package
v1.11.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Thread

type Thread struct {
	// contains filtered or unexported fields
}

Thread represents an OS thread.

func New

func New() *Thread

New creates a new thread.

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

func (*Thread) Call

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

Call calls f on the thread.

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

Call blocks if Loop is not called.

func (*Thread) Loop

func (t *Thread) Loop(context context.Context)

Loop starts the thread loop.

Loop must be called on the thread.

Loop can be called multiple times.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL