mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-21 00:26:16 +00:00
Stuff.
This commit is contained in:
@@ -22,7 +22,7 @@ WaitpidQueue::WaitpidQueue() {
|
|||||||
if (elapsed >= wait_time)
|
if (elapsed >= wait_time)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
std::this_thread::sleep_for(100ms);
|
std::this_thread::sleep_for(50ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -49,7 +49,7 @@ WaitpidQueue::WaitpidQueue() {
|
|||||||
m_wakeup_worker.store(false, std::memory_order_release);
|
m_wakeup_worker.store(false, std::memory_order_release);
|
||||||
}
|
}
|
||||||
|
|
||||||
wait_time = std::max(10s, wait_time * 2);
|
wait_time = std::min(10s, wait_time * 2);
|
||||||
|
|
||||||
for (int pid : queue) {
|
for (int pid : queue) {
|
||||||
if (::waitpid(pid, nullptr, WNOHANG) == 0)
|
if (::waitpid(pid, nullptr, WNOHANG) == 0)
|
||||||
@@ -98,10 +98,10 @@ WaitpidQueue::close_pid(pid_t pid) {
|
|||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> guard(m_mutex);
|
std::lock_guard<std::mutex> guard(m_mutex);
|
||||||
|
|
||||||
if (!m_queue.empty()) {
|
// if (!m_queue.empty()) {
|
||||||
m_queue.push_back(pid);
|
// m_queue.push_back(pid);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
m_queue.push_back(pid);
|
m_queue.push_back(pid);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user