From 9b6077b100015dcfb64f05c6c3eb89033a3e54c3 Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Tue, 7 Oct 2014 17:02:04 -0500 Subject: [PATCH] Update live test prog --- _fixtures/livetestprog.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/_fixtures/livetestprog.go b/_fixtures/livetestprog.go index 3cd4bdae..f60b4569 100644 --- a/_fixtures/livetestprog.go +++ b/_fixtures/livetestprog.go @@ -3,7 +3,7 @@ package main import ( "fmt" "os" - "time" + "runtime" ) func printPid(pid int) { @@ -15,13 +15,12 @@ func sayhi() { } func main() { + runtime.LockOSThread() pid := os.Getpid() printPid(pid) - time.Sleep(3 * time.Second) for { printPid(pid) - time.Sleep(1 * time.Second) sayhi() } }