1
0
mirror of https://github.com/golang/go synced 2024-11-26 10:08:23 -07:00

runtime: document that LockOSThread in init locks to thread

This is more or less implied by the spec language on initialization,
but restate it for clarity.

Fixes #23112

Change-Id: Ibe5385acafe4eac38823de98a025cd37f7a77d3b
Reviewed-on: https://go-review.googlesource.com/103399
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Ian Lance Taylor 2018-03-29 11:26:27 -07:00
parent 2d4ccbfe51
commit eb4f33243e

View File

@ -3472,6 +3472,10 @@ func dolockOSThread() {
// If the calling goroutine exits without unlocking the thread,
// the thread will be terminated.
//
// All init functions are run on the startup thread. Calling LockOSThread
// from an init function will cause the main function to be invoked on
// that thread.
//
// A goroutine should call LockOSThread before calling OS services or
// non-Go library functions that depend on per-thread state.
func LockOSThread() {