[Refactor] (P13 W5 S3): the apply side's backend comes through MG_Backend's ApplyRoleBackend hook, which ServerLoop installs.

This commit is contained in:
2026-10-06 12:13:37 -04:00
parent bb45648c41
commit 7f194a8579
4 changed files with 45 additions and 1 deletions
+13
View File
@@ -9,6 +9,7 @@
// P5 package v1: the apply thread, its affinity, its parking, and the EGL ownership move.
#include "ServerLoop.h"
#include <MG_Backend/Record/ApplyRoleBackend.h>
#include "ApplyThreadPolicy.h"
#include "SessionRuntime.h"
#include <MG_Remote/FatalFunnel.h>
@@ -1460,6 +1461,18 @@ namespace MobileGL::MG_Remote::Server {
return instance;
}
// P13 W5: the record arm asks for the apply side's backend through MG_Backend's hook
// (Record/ApplyRoleBackend.h), which has no MG_Remote to name. Installed at static init so it
// answers from the first record on, exactly as the direct ServerLoopInstance().Backend() did.
namespace {
[[maybe_unused]] const bool g_applyRoleBackendHookInstalled = [] {
MG_Backend::gApplyRoleBackendHook = []() -> MG_Backend::BackendObject* {
return ServerLoopInstance().Backend();
};
return true;
}();
} // namespace
// ---------------------------------------------------------------------------------
// The control-frame dispatch and the twelve EGL forwarders (P5f, package fc)
// ---------------------------------------------------------------------------------