mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-29 05:55:16 -04:00
Stratosphere: Add IWaitable, WaitableManager
This commit is contained in:
parent
8e25534912
commit
cbb0a084a6
8 changed files with 244 additions and 9 deletions
26
stratosphere/loader/source/waitablemanager.hpp
Normal file
26
stratosphere/loader/source/waitablemanager.hpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
#include <switch.h>
|
||||
#include <vector>
|
||||
|
||||
#include "iwaitable.hpp"
|
||||
|
||||
class WaitableManager {
|
||||
std::vector<IWaitable *> waitables;
|
||||
|
||||
u64 timeout;
|
||||
|
||||
public:
|
||||
WaitableManager(u64 t) : waitables(0), timeout(t) { }
|
||||
~WaitableManager() {
|
||||
/* This should call the destructor for every waitable. */
|
||||
for (auto & waitable : waitables) {
|
||||
delete waitable;
|
||||
}
|
||||
waitables.clear();
|
||||
}
|
||||
|
||||
unsigned int get_num_signalable();
|
||||
void add_waitable(IWaitable *waitable);
|
||||
void delete_waitable(IWaitable *waitable);
|
||||
void process();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue