浏览文件
main_darwin_gui.go
16 行 · 501 B历史下载| 1 | //go:build darwin |
| 2 | |
| 3 | // SPDX-FileCopyrightText: Copyright The Lima Authors |
| 4 | // SPDX-License-Identifier: Apache-2.0 |
| 5 | |
| 6 | package main |
| 7 | |
| 8 | import "runtime" |
| 9 | |
| 10 | func init() { |
| 11 | // Lock the main goroutine to the initial process thread before main() runs. |
| 12 | // VZVirtualMachineView requires GUI operations on the initial thread; without |
| 13 | // this, Go's scheduler may migrate the goroutine before hostagent starts. |
| 14 | // Assumes no other package init() triggers a scheduling point before this runs. |
| 15 | runtime.LockOSThread() |
| 16 | } |

