2018-11-12 08:54:22 +00:00
|
|
|
#include <mesosphere/processes/KLightSession.hpp>
|
|
|
|
#include <mesosphere/threading/KScopedCriticalSection.hpp>
|
2018-11-12 11:30:58 +00:00
|
|
|
#include <mesosphere/threading/KThread.hpp>
|
|
|
|
#include <mesosphere/core/KCoreContext.hpp>
|
2018-11-11 21:53:15 +00:00
|
|
|
|
|
|
|
namespace mesosphere
|
|
|
|
{
|
|
|
|
|
|
|
|
KLightClientSession::~KLightClientSession()
|
|
|
|
{
|
2018-11-12 08:54:22 +00:00
|
|
|
parent->Terminate(false);
|
2018-11-11 21:53:15 +00:00
|
|
|
}
|
|
|
|
|
2018-11-12 11:30:58 +00:00
|
|
|
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;
|
|
|
|
}
|
2018-11-11 21:53:15 +00:00
|
|
|
|
|
|
|
}
|