mesosphere: Add convenience KScopedCriticalSection

This commit is contained in:
Michael Scire
2018-11-05 03:47:15 -08:00
parent 9b1fb0c6df
commit 600afa5f0f
4 changed files with 16 additions and 8 deletions

View File

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