Atmosphere/mesosphere/source/processes/KServerPort.cpp

37 lines
823 B
C++
Raw Normal View History

2018-11-12 14:52:57 +01: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;
}
bool KServerPort::IsSignaled() const
{
2018-11-12 15:48:03 +01:00
if (!parent->isLight) {
return false; // TODO
} else {
return !lightServerSessions.empty();
}
}
Result KServerPort::AddServerSession(KLightServerSession &lightServerSession)
{
KScopedCriticalSection critsec{};
bool wasEmpty = lightServerSessions.empty();
lightServerSessions.push_back(lightServerSession);
if (wasEmpty && !lightServerSessions.empty()) {
NotifyWaiters();
}
return ResultSuccess();
2018-11-12 14:52:57 +01:00
}
}