mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 03:53:42 +00:00
36 lines
682 B
Go
36 lines
682 B
Go
// +build scheduler.none
|
|
|
|
package task
|
|
|
|
import "unsafe"
|
|
|
|
//go:linkname runtimePanic runtime.runtimePanic
|
|
func runtimePanic(str string)
|
|
|
|
func Pause() {
|
|
runtimePanic("scheduler is disabled")
|
|
}
|
|
|
|
func Current() *Task {
|
|
runtimePanic("scheduler is disabled")
|
|
return nil
|
|
}
|
|
|
|
//go:noinline
|
|
func start(fn uintptr, args unsafe.Pointer) {
|
|
// The compiler will error if this is reachable.
|
|
runtimePanic("scheduler is disabled")
|
|
}
|
|
|
|
type state struct{}
|
|
|
|
func (t *Task) Resume() {
|
|
runtimePanic("scheduler is disabled")
|
|
}
|
|
|
|
// OnSystemStack returns whether the caller is running on the system stack.
|
|
func OnSystemStack() bool {
|
|
// This scheduler does not do any stack switching.
|
|
return true
|
|
}
|