[Yellowstone] Use mutex to wait for denali to spawn VFS.

Kind of a hacky way to pass a signal between threads but works as
a POC for thread synchronization.
This commit is contained in:
Drew Galbraith 2023-10-25 19:08:00 -07:00
parent 6cb0041253
commit adfffdd3c3
3 changed files with 36 additions and 17 deletions

View file

@ -3,6 +3,7 @@
#include <glacier/memory/unique_ptr.h>
#include <glacier/status/error_or.h>
#include <mammoth/endpoint_server.h>
#include <mammoth/mutex.h>
#include <mammoth/port_server.h>
#include <mammoth/thread.h>
@ -18,6 +19,8 @@ class YellowstoneServer : public YellowstoneServerBase {
glcr::ErrorCode HandleRegisterEndpoint(const RegisterEndpointRequest&,
Empty&) override;
glcr::ErrorCode WaitDenaliRegistered();
private:
// TODO: Store these in a data structure.
z_cap_t denali_cap_ = 0;
@ -27,5 +30,7 @@ class YellowstoneServer : public YellowstoneServerBase {
PciReader pci_reader_;
YellowstoneServer(z_cap_t endpoint_cap);
Mutex has_denali_mutex_;
YellowstoneServer(z_cap_t endpoint_cap, Mutex&& mutex);
};