Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: no examples for LockOSThread and UnlockOSThread #31911
What version of Go are you using (
changed the title
No examples in documentation for `runtime.LockOSThread` and `runtime.UnlockOSThread()`
May 8, 2019
These function are essential for doing GUI and graphic programming on many OS, because on many systems, only the first main thread may interact with the GUI or the OS's graphics subsystem.
In general, I feel that Go needs to focus not only on being a back end language but also more on native development. An official go lang blog post on the topic, with descriptions of LockOsThread and UnlockOsThread included would be very welcome indeed, and time permitting, I would certainly like to help proofread or smake suggestions for such a post.
On those situations one would have to "acquire" the main thread early in the application's startup (the
Actually I think that the example provided in the Wiki is a great one:
Perhaps adding such link to the