aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/zenserverprocess.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenutil/zenserverprocess.cpp')
-rw-r--r--src/zenutil/zenserverprocess.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/zenutil/zenserverprocess.cpp b/src/zenutil/zenserverprocess.cpp
index f5bc088a5..34eec9790 100644
--- a/src/zenutil/zenserverprocess.cpp
+++ b/src/zenutil/zenserverprocess.cpp
@@ -403,7 +403,7 @@ ZenServerState::ZenServerEntry::IsReady() const
}
bool
-ZenServerState::ZenServerEntry::AddSponsorProcess(uint32_t PidToAdd)
+ZenServerState::ZenServerEntry::AddSponsorProcess(uint32_t PidToAdd, uint64_t Timeout)
{
uint32_t ServerPid = Pid.load();
auto WaitForPickup = [&](uint32_t AddedSlotIndex) {
@@ -427,13 +427,13 @@ ZenServerState::ZenServerEntry::AddSponsorProcess(uint32_t PidToAdd)
{
if (SponsorPids[SponsorIndex].load(std::memory_order_relaxed) == PidToAdd)
{
- return WaitForPickup(SponsorIndex);
+ return Timeout == 0 ? true : WaitForPickup(SponsorIndex);
}
uint32_t Expected = 0;
if (SponsorPids[SponsorIndex].compare_exchange_strong(Expected, PidToAdd))
{
// Success!
- return WaitForPickup(SponsorIndex);
+ return Timeout == 0 ? true : WaitForPickup(SponsorIndex);
}
}
@@ -865,6 +865,8 @@ ZenServerInstance::OnServerReady()
m_BasePort = Entry->EffectiveListenPort;
CreateShutdownEvent(m_BasePort);
+
+ ZEN_DEBUG("Server '{}' is ready on port {}", m_Name, m_BasePort);
}
std::string