1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-15 00:16:48 +00:00
Atmosphere/mesosphere/source/processes/KLightClientSession.cpp
2019-06-03 17:41:08 -07:00

25 lines
718 B
C++

#include <mesosphere/processes/KLightSession.hpp>
#include <mesosphere/threading/KScopedCriticalSection.hpp>
#include <mesosphere/threading/KThread.hpp>
#include <mesosphere/core/KCoreContext.hpp>
namespace mesosphere
{
KLightClientSession::~KLightClientSession()
{
parent->Terminate(false);
}
Result KLightClientSession::SendSyncRequest(LightSessionRequest *request)
{
KScopedCriticalSection critsec{};
Result res;
KThread *curThread = KCoreContext::GetCurrentInstance().GetCurrentThread();
curThread->SetCurrentLightSessionRequest(request);
curThread->ClearSync();
res = parent->server.HandleSyncRequest(*curThread);
return res.IsSuccess() ? curThread->GetSyncResult() : res;
}
}