[mammoth] Run EndpointServer in its own thread.

This commit is contained in:
Drew Galbraith 2023-08-01 16:08:34 -07:00
parent caccb08e16
commit c70b5b0753
4 changed files with 25 additions and 15 deletions

View file

@ -26,7 +26,8 @@ uint64_t main(uint64_t init_port_cap) {
server->CreateClient());
check(stub.Register("denali", *client));
RET_ERR(server->RunServer());
// FIXME: Add thread join.
Thread server_thread = server->RunServer();
check(server_thread.Join());
return 0;
}

View file

@ -14,6 +14,7 @@ uint64_t main(uint64_t port_cap) {
ASSIGN_OR_RETURN(auto server, YellowstoneServer::Create());
Thread registration_thread = server->RunRegistration();
Thread server_thread = server->RunServer();
uint64_t vaddr;
check(ZAddressSpaceMap(gSelfVmasCap, 0, gBootDenaliVmmoCap, &vaddr));
@ -21,7 +22,7 @@ uint64_t main(uint64_t port_cap) {
server->CreateClient());
check(SpawnProcessFromElfRegion(vaddr, glcr::Move(client)));
check(server->RunServer());
check(server_thread.Join());
check(registration_thread.Join());
dbgln("Yellowstone Finished Successfully.");
return 0;