diff options
| author | Richard Musiol <mail@richard-musiol.de> | 2018-05-20 00:56:36 +0200 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2018-06-14 21:50:53 +0000 |
| commit | e083dc6307b6593bdd44b219ffd21699d6f17fd7 (patch) | |
| tree | 2a411d82639a778c6aa107529b1d708034c7a7f1 /src/cmd/trace/annotations_test.go | |
| parent | 5fdacfa89f871888d6f8fde726b8f95f11e674d6 (diff) | |
| download | go-e083dc6307b6593bdd44b219ffd21699d6f17fd7.tar.xz | |
runtime, sycall/js: add support for callbacks from JavaScript
This commit adds support for JavaScript callbacks back into
WebAssembly. This is experimental API, just like the rest of the
syscall/js package. The time package now also uses this mechanism
to properly support timers without resorting to a busy loop.
JavaScript code can call into the same entry point multiple times.
The new RUN register is used to keep track of the program's
run state. Possible values are: starting, running, paused and exited.
If no goroutine is ready any more, the scheduler can put the
program into the "paused" state and the WebAssembly code will
stop running. When a callback occurs, the JavaScript code puts
the callback data into a queue and then calls into WebAssembly
to allow the Go code to continue running.
Updates #18892
Updates #25506
Change-Id: Ib8701cfa0536d10d69bd541c85b0e2a754eb54fb
Reviewed-on: https://go-review.googlesource.com/114197
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/cmd/trace/annotations_test.go')
| -rw-r--r-- | src/cmd/trace/annotations_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/trace/annotations_test.go b/src/cmd/trace/annotations_test.go index 5d2b226b35..a9068d53c1 100644 --- a/src/cmd/trace/annotations_test.go +++ b/src/cmd/trace/annotations_test.go @@ -1,3 +1,9 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !js + package main import ( |
