mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-18 09:14:01 -04:00
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
24 lines
425 B
Go
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()
|
|
}()
|
|
}
|