mesosphere: Add convenience KScopedCriticalSection

This commit is contained in:
Michael Scire committed 2019-06-03 17:41:03 -07:00
1 parent 9b1fb0c6df
commit 600afa5f0f
4 files changed
+16 -8

No files matched your search

@@ -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()};
};
}