[Yellowstone] Start teton after voyageurs is available.

This commit is contained in:
Drew Galbraith 2024-02-24 15:12:21 -08:00
parent 02d4f8c80e
commit 8fb55f56b6
3 changed files with 10 additions and 0 deletions

View File

@ -49,6 +49,10 @@ uint64_t main(uint64_t port_cap) {
for (glcr::StringView& file : files) { for (glcr::StringView& file : files) {
if (!file.empty()) { if (!file.empty()) {
// TODO: Implement startup dependencies.
if (file == "teton") {
server->WaitVoyageursRegistered();
}
mmth::File binary = mmth::File::Open(glcr::StrFormat("/bin/{}", file)); mmth::File binary = mmth::File::Open(glcr::StrFormat("/bin/{}", file));
ASSIGN_OR_RETURN(client_cap, server->CreateClientCap()); ASSIGN_OR_RETURN(client_cap, server->CreateClientCap());

View File

@ -113,6 +113,8 @@ glcr::Status YellowstoneServer::HandleRegisterEndpoint(
// transmit to other processes. // transmit to other processes.
mmth::SetVfsCap(req.endpoint_capability()); mmth::SetVfsCap(req.endpoint_capability());
has_victoriafalls_semaphore_.Signal(); has_victoriafalls_semaphore_.Signal();
} else if (req.endpoint_name() == "voyageurs") {
has_voyageurs_.Signal();
} else { } else {
dbgln("[WARN] Got endpoint cap type: {}", req.endpoint_name().cstr()); dbgln("[WARN] Got endpoint cap type: {}", req.endpoint_name().cstr());
} }
@ -138,4 +140,6 @@ void YellowstoneServer::WaitVictoriaFallsRegistered() {
has_victoriafalls_semaphore_.Wait(); has_victoriafalls_semaphore_.Wait();
} }
void YellowstoneServer::WaitVoyageursRegistered() { has_voyageurs_.Wait(); }
} // namespace yellowstone } // namespace yellowstone

View File

@ -25,6 +25,7 @@ class YellowstoneServer : public YellowstoneServerBase {
void WaitDenaliRegistered(); void WaitDenaliRegistered();
void WaitVictoriaFallsRegistered(); void WaitVictoriaFallsRegistered();
void WaitVoyageursRegistered();
private: private:
glcr::HashMap<glcr::String, z_cap_t> endpoint_map_; glcr::HashMap<glcr::String, z_cap_t> endpoint_map_;
@ -37,6 +38,7 @@ class YellowstoneServer : public YellowstoneServerBase {
mmth::Semaphore has_denali_semaphore_; mmth::Semaphore has_denali_semaphore_;
mmth::Semaphore has_victoriafalls_semaphore_; mmth::Semaphore has_victoriafalls_semaphore_;
mmth::Semaphore has_voyageurs_;
YellowstoneServer(z_cap_t endpoint_cap); YellowstoneServer(z_cap_t endpoint_cap);
}; };