mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-17 08:34:23 -04:00
os: refactor/rewrite entire namespace.
This commit is contained in:
parent
6193283f03
commit
065485b971
181 changed files with 5353 additions and 1929 deletions
|
@ -21,13 +21,13 @@
|
|||
namespace ams::sm::impl {
|
||||
|
||||
/* Utilities. */
|
||||
os::RecursiveMutex &GetUserSessionMutex();
|
||||
os::RecursiveMutex &GetMitmAcknowledgementSessionMutex();
|
||||
os::RecursiveMutex &GetPerThreadSessionMutex();
|
||||
os::Mutex &GetUserSessionMutex();
|
||||
os::Mutex &GetMitmAcknowledgementSessionMutex();
|
||||
os::Mutex &GetPerThreadSessionMutex();
|
||||
|
||||
template<typename F>
|
||||
Result DoWithUserSession(F f) {
|
||||
std::scoped_lock<os::RecursiveMutex &> lk(GetUserSessionMutex());
|
||||
std::scoped_lock lk(GetUserSessionMutex());
|
||||
{
|
||||
R_ABORT_UNLESS(smInitialize());
|
||||
ON_SCOPE_EXIT { smExit(); };
|
||||
|
@ -38,7 +38,7 @@ namespace ams::sm::impl {
|
|||
|
||||
template<typename F>
|
||||
Result DoWithMitmAcknowledgementSession(F f) {
|
||||
std::scoped_lock<os::RecursiveMutex &> lk(GetMitmAcknowledgementSessionMutex());
|
||||
std::scoped_lock lk(GetMitmAcknowledgementSessionMutex());
|
||||
{
|
||||
R_ABORT_UNLESS(smAtmosphereMitmInitialize());
|
||||
ON_SCOPE_EXIT { smAtmosphereMitmExit(); };
|
||||
|
@ -51,7 +51,7 @@ namespace ams::sm::impl {
|
|||
Result DoWithPerThreadSession(F f) {
|
||||
Service srv;
|
||||
{
|
||||
std::scoped_lock<os::RecursiveMutex &> lk(GetPerThreadSessionMutex());
|
||||
std::scoped_lock lk(GetPerThreadSessionMutex());
|
||||
R_ABORT_UNLESS(smAtmosphereOpenSession(&srv));
|
||||
}
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue