diff options
Diffstat (limited to 'src/internal')
-rw-r--r-- | src/internal/task/task.go | 3 | ||||
-rw-r--r-- | src/internal/task/task_asyncify.go | 5 | ||||
-rw-r--r-- | src/internal/task/task_stack.go | 5 |
3 files changed, 5 insertions, 8 deletions
diff --git a/src/internal/task/task.go b/src/internal/task/task.go index c1ee57dda..bce65b582 100644 --- a/src/internal/task/task.go +++ b/src/internal/task/task.go @@ -33,3 +33,6 @@ func getGoroutineStackSize(fn uintptr) uintptr //go:linkname runtime_alloc runtime.alloc func runtime_alloc(size uintptr, layout unsafe.Pointer) unsafe.Pointer + +//go:linkname scheduleTask runtime.scheduleTask +func scheduleTask(*Task) diff --git a/src/internal/task/task_asyncify.go b/src/internal/task/task_asyncify.go index 55a1044e4..637a6b223 100644 --- a/src/internal/task/task_asyncify.go +++ b/src/internal/task/task_asyncify.go @@ -52,7 +52,7 @@ type stackState struct { func start(fn uintptr, args unsafe.Pointer, stackSize uintptr) { t := &Task{} t.state.initialize(fn, args, stackSize) - runqueuePushBack(t) + scheduleTask(t) } //export tinygo_launch @@ -82,9 +82,6 @@ func (s *state) initialize(fn uintptr, args unsafe.Pointer, stackSize uintptr) { s.csp = unsafe.Add(stack, stackSize) } -//go:linkname runqueuePushBack runtime.runqueuePushBack -func runqueuePushBack(*Task) - // currentTask is the current running task, or nil if currently in the scheduler. var currentTask *Task diff --git a/src/internal/task/task_stack.go b/src/internal/task/task_stack.go index 551612425..88a097068 100644 --- a/src/internal/task/task_stack.go +++ b/src/internal/task/task_stack.go @@ -101,15 +101,12 @@ func swapTask(oldStack uintptr, newStack *uintptr) //go:extern tinygo_startTask var startTask [0]uint8 -//go:linkname runqueuePushBack runtime.runqueuePushBack -func runqueuePushBack(*Task) - // start creates and starts a new goroutine with the given function and arguments. // The new goroutine is scheduled to run later. func start(fn uintptr, args unsafe.Pointer, stackSize uintptr) { t := &Task{} t.state.initialize(fn, args, stackSize) - runqueuePushBack(t) + scheduleTask(t) } // OnSystemStack returns whether the caller is running on the system stack. |