1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2025-01-25 10:33:47 +00:00
Atmosphere/mesosphere/source/processes/KServerPort.cpp

37 lines
823 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;
}
bool KServerPort::IsSignaled() const
{
2018-11-12 14:48:03 +00: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 13:52:57 +00:00
}
}