meso: Implement LightSession functions

This commit is contained in:
TuxSH
2018-11-12 12:30:58 +01:00
committed by Michael Scire
parent be3550d382
commit acf32f841c
8 changed files with 177 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
#include <mesosphere/processes/KLightClientSession.hpp>
#include <mesosphere/processes/KLightSession.hpp>
#include <mesosphere/threading/KScopedCriticalSection.hpp>
#include <mesosphere/threading/KThread.hpp>
#include <mesosphere/core/KCoreContext.hpp>
namespace mesosphere
{
@@ -10,5 +11,15 @@ 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;
}
}