Atmosphere/mesosphere/source/processes/KServerPort.cpp

38 lines
840 B
C++
Raw Normal View History

2018-11-12 13:52:57 +00:00
#include <mesosphere/processes/KPort.hpp>
#include <mesosphere/threading/KScopedCriticalSection.hpp>
#include <mesosphere/threading/KThread.hpp>
#include <mesosphere/core/KCoreContext.hpp>
namespace mesosphere
{
KServerPort::~KServerPort()
{
KScopedCriticalSection critsec{};
parent->isServerAlive = false;
2018-11-13 00:14:55 +00:00
// TODO
2018-11-12 13:52:57 +00:00
}
bool KServerPort::IsSignaled() const
{
2018-11-12 14:48:03 +00:00
if (!parent->isLight) {
return false; // TODO
} else {
return !lightServerSessions.empty();
}
}
2018-11-13 00:14:55 +00:00
Result KServerPort::AddLightServerSession(KLightServerSession &lightServerSession)
2018-11-12 14:48:03 +00:00
{
KScopedCriticalSection critsec{};
bool wasEmpty = lightServerSessions.empty();
lightServerSessions.push_back(lightServerSession);
if (wasEmpty && !lightServerSessions.empty()) {
NotifyWaiters();
}
return ResultSuccess();
2018-11-12 13:52:57 +00:00
}
}