meso: impl AddServerSession

This commit is contained in:
TuxSH
2018-11-12 15:48:03 +01:00
committed by Michael Scire
parent 173bde2eca
commit efe7325af3
5 changed files with 40 additions and 3 deletions

View File

@@ -14,7 +14,23 @@ KServerPort::~KServerPort()
bool KServerPort::IsSignaled() const
{
return false; // TODO
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();
}
}