mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-15 00:16:48 +00:00
37 lines
840 B
C++
37 lines
840 B
C++
#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;
|
|
// TODO
|
|
}
|
|
|
|
bool KServerPort::IsSignaled() const
|
|
{
|
|
if (!parent->isLight) {
|
|
return false; // TODO
|
|
} else {
|
|
return !lightServerSessions.empty();
|
|
}
|
|
}
|
|
|
|
Result KServerPort::AddLightServerSession(KLightServerSession &lightServerSession)
|
|
{
|
|
KScopedCriticalSection critsec{};
|
|
bool wasEmpty = lightServerSessions.empty();
|
|
lightServerSessions.push_back(lightServerSession);
|
|
if (wasEmpty && !lightServerSessions.empty()) {
|
|
NotifyWaiters();
|
|
}
|
|
|
|
return ResultSuccess();
|
|
}
|
|
|
|
}
|