Files
wisp-open/internal/xhotkey/mainthread/os.go
T
2026-04-09 22:57:06 -07:00

20 lines
652 B
Go

// Copyright 2022 The golang.design Initiative Authors.
// All rights reserved. Use of this source code is governed
// by a MIT license that can be found in the LICENSE file.
//
// Written by Changkun Ou <changkun.de>
//go:build windows || linux || (darwin && !cgo)
package mainthread
import "golang.design/x/mainthread"
// Call calls f on the main thread and blocks until f finishes.
func Call(f func()) { mainthread.Call(f) }
// Init initializes the functionality of running arbitrary subsequent functions be called on the main system thread.
//
// Init must be called in the main.main function.
func Init(main func()) { mainthread.Init(main) }