mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-04-23 21:14:49 +00:00
Stratosphere: Simplify initialization
This commit is contained in:
parent
98ea14e880
commit
e78bd11a05
2 changed files with 9 additions and 9 deletions
|
@ -14,13 +14,13 @@ class WaitableManager : public WaitableManagerBase {
|
|||
protected:
|
||||
std::vector<IWaitable *> to_add_waitables;
|
||||
std::vector<IWaitable *> waitables;
|
||||
u64 timeout;
|
||||
u64 timeout = 0;
|
||||
HosMutex lock;
|
||||
std::atomic_bool has_new_items;
|
||||
std::atomic_bool has_new_items = false;
|
||||
private:
|
||||
void process_internal(bool break_on_timeout);
|
||||
public:
|
||||
WaitableManager(u64 t) : waitables(0), timeout(t), has_new_items(false) { }
|
||||
WaitableManager(u64 t) : timeout(t) { }
|
||||
~WaitableManager() override {
|
||||
/* This should call the destructor for every waitable. */
|
||||
std::for_each(waitables.begin(), waitables.end(), std::default_delete<IWaitable>{});
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
#include <vector>
|
||||
|
||||
class WaitableManagerBase {
|
||||
std::atomic<u64> cur_priority;
|
||||
std::atomic<u64> cur_priority = 0;
|
||||
public:
|
||||
WaitableManagerBase() : cur_priority(0) { }
|
||||
virtual ~WaitableManagerBase() { }
|
||||
|
||||
u64 get_priority() {
|
||||
WaitableManagerBase() = default;
|
||||
virtual ~WaitableManagerBase() = default;
|
||||
|
||||
u64 get_priority() {
|
||||
return std::atomic_fetch_add(&cur_priority, (u64)1);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue