diff options
author | xengineering <mail2xengineering@protonmail.com> | 2021-05-27 09:59:37 +0200 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2021-05-27 09:59:37 +0200 |
commit | 5bf517d5692541dfa1f4fc506c51e0fb7b8a76b4 (patch) | |
tree | ac5855d61208863e5ac6a90df5381f62f16df6b1 | |
parent | b37c8b22a954f52c280722a6f9ff41cbc8ecf8d3 (diff) | |
download | stlscope-5bf517d5692541dfa1f4fc506c51e0fb7b8a76b4.tar stlscope-5bf517d5692541dfa1f4fc506c51e0fb7b8a76b4.tar.zst stlscope-5bf517d5692541dfa1f4fc506c51e0fb7b8a76b4.zip |
Lock OS Thread later
In earlier versions the goroutine was locked
to the OS thread very early. This is not
needed for e.g. the help page and created
confusing log output.
-rw-r--r-- | main.go | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -8,12 +8,6 @@ import ( "flag" ) -func init() { - // lock this program to one OS thread (details: https://golang.org/pkg/runtime/#LockOSThread) - log.Println("Locking OS thread") - runtime.LockOSThread() -} - func main() { // read command line arguments @@ -27,6 +21,10 @@ func main() { } vertices = stl.toVertices() + // lock this program to one OS thread (details: https://golang.org/pkg/runtime/#LockOSThread) + log.Println("Locking OS thread") + runtime.LockOSThread() + // initialize application (includes GLFW/window) var app App = newApp(&stl) defer app.terminate() // GLFW needs to be terminated! |