//go:build scheduler.none package task import "unsafe" // state is a no-op placeholder. With scheduler.none there is no // stack switching, so the state struct is empty. type state struct{} // currentTask is the single running task. var currentTask Task // Current returns the (only) active task. func Current() *Task { return ¤tTask } // Pause panics — with no scheduler there is nothing to resume us. func Pause() { // Debug: trap to get a stack trace. runtimePanic("deadlock: Pause called with no scheduler") } // Resume is unreachable with scheduler.none. func (t *Task) Resume() { runtimePanic("deadlock: Resume called with no scheduler") } // OnSystemStack returns true — with no scheduler, we're always on // the system stack. func OnSystemStack() bool { return true } // SystemStack returns 0. Never called when OnSystemStack() is true. func SystemStack() uintptr { return 0 } // start is a no-op under scheduler.none — there are no goroutines to start. func start(fn uintptr, args unsafe.Pointer, stackSize uintptr) { runtimePanic("cannot start goroutine with no scheduler") } //go:linkname runtimePanic runtime.runtimePanic func runtimePanic(str string)