mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 20:43:40 +00:00
Add goroutines and function pointers
This commit is contained in:
@@ -6,6 +6,13 @@ const Compiler = "tgo"
|
||||
// The bitness of the CPU (e.g. 8, 32, 64). Set by the compiler as a constant.
|
||||
var TargetBits uint8
|
||||
|
||||
func Sleep(d Duration) {
|
||||
// This function is treated specially by the compiler: when goroutines are
|
||||
// used, it is transformed into a llvm.coro.suspend() call.
|
||||
// When goroutines are not used this function behaves as normal.
|
||||
sleep(d)
|
||||
}
|
||||
|
||||
func _panic(message interface{}) {
|
||||
printstring("panic: ")
|
||||
printitf(message)
|
||||
|
||||
Reference in New Issue
Block a user