mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-08-16 15:29:00 +00:00
kern: implement SvcAcceptSession
This commit is contained in:
parent
f52232f0f2
commit
78da7422ae
4 changed files with 67 additions and 3 deletions
|
@ -119,4 +119,36 @@ namespace ams::kern {
|
|||
}
|
||||
}
|
||||
|
||||
KServerSession *KServerPort::AcceptSession() {
|
||||
MESOSPHERE_ASSERT_THIS();
|
||||
MESOSPHERE_ASSERT(!this->IsLight());
|
||||
|
||||
KScopedSchedulerLock sl;
|
||||
|
||||
/* Return the first session in the list. */
|
||||
if (this->session_list.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
KServerSession *session = std::addressof(this->session_list.front());
|
||||
this->session_list.pop_front();
|
||||
return session;
|
||||
}
|
||||
|
||||
KLightServerSession *KServerPort::AcceptLightSession() {
|
||||
MESOSPHERE_ASSERT_THIS();
|
||||
MESOSPHERE_ASSERT(this->IsLight());
|
||||
|
||||
KScopedSchedulerLock sl;
|
||||
|
||||
/* Return the first session in the list. */
|
||||
if (this->light_session_list.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
KLightServerSession *session = std::addressof(this->light_session_list.front());
|
||||
this->light_session_list.pop_front();
|
||||
return session;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue