diff options
| author | Ian Lance Taylor <iant@golang.org> | 2018-03-29 11:26:27 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2018-04-13 03:15:02 +0000 |
| commit | eb4f33243ece5874d2690c4b9bc72cb47f8da772 (patch) | |
| tree | 4916caa0bb6b70b28a8c628d1c36d9895c2a73dd /src | |
| parent | 2d4ccbfe51c3a51cf59c91ac384a37aa3d427176 (diff) | |
| download | go-eb4f33243ece5874d2690c4b9bc72cb47f8da772.tar.xz | |
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>
Diffstat (limited to 'src')
| -rw-r--r-- | src/runtime/proc.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 98d78f0c82..a4a93e7878 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -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() { |
