
Areas that need improving: * Code cleanup * Promote breakpoints back out of thread context * Fix potential bug in "Next" implementation, when thread contexts switch
29 lines
283 B
Go
29 lines
283 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"runtime"
|
|
"time"
|
|
)
|
|
|
|
func printPid(pid int) {
|
|
fmt.Println(pid)
|
|
}
|
|
|
|
func sayhi() {
|
|
fmt.Println("hi")
|
|
}
|
|
|
|
func main() {
|
|
runtime.LockOSThread()
|
|
pid := os.Getpid()
|
|
printPid(pid)
|
|
time.Sleep(10 * time.Second)
|
|
|
|
for {
|
|
printPid(pid)
|
|
sayhi()
|
|
}
|
|
}
|