coroutines truly are cursed
This commit is contained in:
@@ -11,6 +11,7 @@ class WindowManager
|
||||
public:
|
||||
WindowManager();
|
||||
~WindowManager();
|
||||
Job init();
|
||||
PWindow addWindow(const WindowCreateInfo &createInfo);
|
||||
void notifyWindowClosed(PWindow window);
|
||||
static Gfx::PGraphics getGraphics()
|
||||
@@ -21,9 +22,16 @@ public:
|
||||
{
|
||||
return windows.size();
|
||||
}
|
||||
void waitForCompletion()
|
||||
{
|
||||
std::unique_lock lock(windowsLock);
|
||||
windowsCV.wait(lock);
|
||||
}
|
||||
|
||||
private:
|
||||
Array<PWindow> windows;
|
||||
std::mutex windowsLock;
|
||||
std::condition_variable windowsCV;
|
||||
static Gfx::PGraphics graphics;
|
||||
};
|
||||
DEFINE_REF(WindowManager)
|
||||
|
||||
Reference in New Issue
Block a user