mesosphere: Add convenience KScopedCriticalSection
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <mutex>
|
||||
#include <mesosphere/core/util.hpp>
|
||||
#include <mesosphere/threading/KMultiLevelQueue.hpp>
|
||||
#include <mesosphere/threading/KThread.hpp>
|
||||
@@ -127,4 +128,11 @@ class KScheduler {
|
||||
}
|
||||
};
|
||||
|
||||
// Convenience
|
||||
|
||||
class KScopedCriticalSection {
|
||||
private:
|
||||
std::scoped_lock<KCriticalSection> lk{KScheduler::GetCriticalSection()};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user