From ce06b7b66386f592df26ca089b470cc5b40ecd39 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 18 Dec 2025 23:51:47 +0900 Subject: internal/pipewire: inform conn of blocking intent The interface does not expose underlying kernel notification mechanisms. This change removes the need to poll in situations were the next call might block. This is made cumbersome by the SyscallConn interface left over from a previous implementation, it will be replaced in a later commit as the current implementation does not make use of any net.Conn methods other than Close. Signed-off-by: Ophestra --- internal/system/pipewire_test.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'internal/system') diff --git a/internal/system/pipewire_test.go b/internal/system/pipewire_test.go index 9c4950c6..a39237f8 100644 --- a/internal/system/pipewire_test.go +++ b/internal/system/pipewire_test.go @@ -6,6 +6,7 @@ import ( "path" "syscall" "testing" + "time" "hakurei.app/container/stub" "hakurei.app/internal/acl" @@ -497,6 +498,12 @@ type stubPipeWireConn struct { curSendmsg int } +func (conn *stubPipeWireConn) MightBlock(timeout time.Duration) { + if timeout != 5*time.Second { + panic("unexpected timeout " + timeout.String()) + } +} + // Recvmsg marshals and copies a stubMessage prepared ahead of time. func (conn *stubPipeWireConn) Recvmsg(p, _ []byte, _ int) (n, _, recvflags int, err error) { defer func() { conn.curRecvmsg++ }() -- cgit v1.3.1