internal/outcome: remove guard on main
All checks were successful
Test / Create distribution (push) Successful in 33s
Test / Sandbox (push) Successful in 2m20s
Test / Hakurei (push) Successful in 3m7s
Test / Sandbox (race detector) (push) Successful in 4m8s
Test / Hpkg (push) Successful in 4m9s
Test / Hakurei (race detector) (push) Successful in 4m54s
Test / Flake checks (push) Successful in 1m29s
All checks were successful
Test / Create distribution (push) Successful in 33s
Test / Sandbox (push) Successful in 2m20s
Test / Hakurei (push) Successful in 3m7s
Test / Sandbox (race detector) (push) Successful in 4m8s
Test / Hpkg (push) Successful in 4m9s
Test / Hakurei (race detector) (push) Successful in 4m54s
Test / Flake checks (push) Successful in 1m29s
This is no longer exported. Such a check is pointless. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"sync/atomic"
|
|
||||||
|
|
||||||
"hakurei.app/hst"
|
"hakurei.app/hst"
|
||||||
"hakurei.app/message"
|
"hakurei.app/message"
|
||||||
@@ -26,12 +25,9 @@ type outcome struct {
|
|||||||
sys *system.I
|
sys *system.I
|
||||||
// Transmitted to shim. Populated during finalise.
|
// Transmitted to shim. Populated during finalise.
|
||||||
state *outcomeState
|
state *outcomeState
|
||||||
// Kept for saving to [state].
|
// Retained for registering current instance.
|
||||||
config *hst.Config
|
config *hst.Config
|
||||||
|
|
||||||
// Whether the current process is in outcome.main.
|
|
||||||
active atomic.Bool
|
|
||||||
|
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
syscallDispatcher
|
syscallDispatcher
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,10 +206,6 @@ func (ms mainState) fatal(fallback string, ferr error) {
|
|||||||
|
|
||||||
// main carries out outcome and terminates. main does not return.
|
// main carries out outcome and terminates. main does not return.
|
||||||
func (k *outcome) main(msg message.Msg) {
|
func (k *outcome) main(msg message.Msg) {
|
||||||
if !k.active.CompareAndSwap(false, true) {
|
|
||||||
panic("outcome: attempted to run twice")
|
|
||||||
}
|
|
||||||
|
|
||||||
if k.ctx == nil || k.sys == nil || k.state == nil {
|
if k.ctx == nil || k.sys == nil || k.state == nil {
|
||||||
panic("outcome: did not finalise")
|
panic("outcome: did not finalise")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user