diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-08-22 22:24:14 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-08-22 22:24:14 +0900 |
| commit | 1c692bfb7926c0f28cf7f38ca7b49f4941fd2b90 (patch) | |
| tree | 7c96da4c637fa31115131e35510229f6a5b0f843 /container/dispatcher.go | |
| parent | 141a18999f36d3e6211d99b24a355d8ea908f32a (diff) | |
container/init: call lockOSThread through dispatcher
This degrades test performance if not stubbed out.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/dispatcher.go')
| -rw-r--r-- | container/dispatcher.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/container/dispatcher.go b/container/dispatcher.go index 2482f0b3..86837b9d 100644 --- a/container/dispatcher.go +++ b/container/dispatcher.go @@ -8,6 +8,7 @@ import ( "os/exec" "os/signal" "path/filepath" + "runtime" "syscall" "hakurei.app/container/seccomp" @@ -21,6 +22,9 @@ type osFile interface { // syscallDispatcher provides methods that make state-dependent system calls as part of their behaviour. type syscallDispatcher interface { + // lockOSThread provides [runtime.LockOSThread]. + lockOSThread() + // setPtracer provides [SetPtracer]. setPtracer(pid uintptr) error // setDumpable provides [SetDumpable]. @@ -136,6 +140,8 @@ type syscallDispatcher interface { // direct implements syscallDispatcher on the current kernel. type direct struct{} +func (direct) lockOSThread() { runtime.LockOSThread() } + func (direct) setPtracer(pid uintptr) error { return SetPtracer(pid) } func (direct) setDumpable(dumpable uintptr) error { return SetDumpable(dumpable) } func (direct) setNoNewPrivs() error { return SetNoNewPrivs() } |
