Files
bbedward f482642880 sysupdate: check only on demand, run at low priority, fix the settings page
scrollbar: interface style toggle and no scrollbars in the dash
dash: never allow scrollbars
cc: widget sheet cards, header close button and content-sized dialogs
2026-09-29 16:30:04 -04:00

24 lines
425 B
Go

//go:build linux
package lowprio
import (
"runtime"
"golang.org/x/sys/unix"
)
func LowerThreadPriority() {
_ = unix.Setpriority(unix.PRIO_PROCESS, unix.Gettid(), 19)
}
// The thread is never unlocked, so it dies with the goroutine instead of rejoining the pool niced.
// Processes started by job inherit the priority.
func Go(job func()) {
go func() {
runtime.LockOSThread()
LowerThreadPriority()
job()
}()
}