Faster unchanged polls; orphan-core cleanup on listen ports; clearer busy-port errors; cores only from binDir; incremental server list; CSP without Google Fonts; single-instance activates existing window; close-to-tray without kill-others or balloon. Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
282 B
Go
17 lines
282 B
Go
//go:build !windows && !plan9
|
|
|
|
package singleinstance
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func flockExclusive(f *os.File) error {
|
|
return syscall.Flock(int(f.Fd()), syscall.LOCK_EX|syscall.LOCK_NB)
|
|
}
|
|
|
|
func funlock(f *os.File) error {
|
|
return syscall.Flock(int(f.Fd()), syscall.LOCK_UN)
|
|
}
|