#include "config.h"
#include <boost/program_options.hpp>
#include <boost/tuple/tuple.hpp>
+#include <thread>
#ifndef _WIN32
# include <sys/types.h>
Application::DeclareRLimitProcesses(Application::GetDefaultRLimitProcesses());
Application::DeclareRLimitStack(Application::GetDefaultRLimitStack());
#endif /* __linux__ */
- Application::DeclareConcurrency(boost::thread::hardware_concurrency());
+ Application::DeclareConcurrency(std::thread::hardware_concurrency());
ScriptGlobal::Set("AttachDebugger", false);
#include <sstream>
#include <iostream>
#include <fstream>
+#include <thread>
#ifdef __linux__
#include <sys/prctl.h>
#endif /* __linux__ */
{
l_Restarting = false;
- boost::thread t(std::bind(&ReloadProcessCallbackInternal, pr));
+ std::thread t(std::bind(&ReloadProcessCallbackInternal, pr));
t.detach();
}
*/
int Application::GetConcurrency(void)
{
- Value defaultConcurrency = boost::thread::hardware_concurrency();
+ Value defaultConcurrency = std::thread::hardware_concurrency();
return ScriptGlobal::Get("Concurrency", &defaultConcurrency);
}
#include "base/json.hpp"
#include <boost/algorithm/string/join.hpp>
#include <boost/thread/once.hpp>
+#include <thread>
#include <iostream>
#ifndef _WIN32
{
/* Note to self: Make sure this runs _after_ we've daemonized. */
for (int tid = 0; tid < IOTHREADS; tid++) {
- boost::thread t(std::bind(&Process::IOThreadProc, tid));
+ std::thread t(std::bind(&Process::IOThreadProc, tid));
t.detach();
}
}
it->second.Events = events;
- if (se->m_EnginePrivate && boost::this_thread::get_id() == m_Threads[tid].get_id())
+ if (se->m_EnginePrivate && std::this_thread::get_id() == m_Threads[tid].get_id())
((pollfd *)se->m_EnginePrivate)->events = events;
else
m_FDChanged[tid] = true;
InitializeThread(tid);
- m_Threads[tid] = boost::thread(std::bind(&SocketEventEngine::ThreadProc, this, tid));
+ m_Threads[tid] = std::thread(std::bind(&SocketEventEngine::ThreadProc, this, tid));
}
}
{
int tid = sid % SOCKET_IOTHREADS;
- if (boost::this_thread::get_id() == m_Threads[tid].get_id())
+ if (std::this_thread::get_id() == m_Threads[tid].get_id())
return;
if (wait) {
#include "base/i2-base.hpp"
#include "base/socket.hpp"
-#include <boost/thread.hpp>
+#include <thread>
#ifndef _WIN32
# include <poll.h>
virtual void Unregister(SocketEvents *se) = 0;
virtual void ChangeEvents(SocketEvents *se, int events) = 0;
- boost::thread m_Threads[SOCKET_IOTHREADS];
+ std::thread m_Threads[SOCKET_IOTHREADS];
SOCKET m_EventFDs[SOCKET_IOTHREADS][2];
bool m_FDChanged[SOCKET_IOTHREADS];
boost::mutex m_EventMutex[SOCKET_IOTHREADS];
for (size_t i = 0; i < sizeof(m_Queues) / sizeof(m_Queues[0]); i++)
m_Queues[i].SpawnWorker(m_ThreadGroup);
- m_MgmtThread = boost::thread(std::bind(&ThreadPool::ManagerThreadProc, this));
+ m_MgmtThread = std::thread(std::bind(&ThreadPool::ManagerThreadProc, this));
}
void ThreadPool::Stop(void)
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
#include <deque>
+#include <thread>
namespace icinga
{
boost::thread_group m_ThreadGroup;
- boost::thread m_MgmtThread;
+ std::thread m_MgmtThread;
boost::mutex m_MgmtMutex;
boost::condition_variable m_MgmtCV;
bool m_Stopped;
#include "base/timer.hpp"
#include "base/debug.hpp"
#include "base/utility.hpp"
-#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/key_extractors.hpp>
+#include <thread>
using namespace icinga;
static boost::mutex l_TimerMutex;
static boost::condition_variable l_TimerCV;
-static boost::thread l_TimerThread;
+static std::thread l_TimerThread;
static bool l_StopTimerThread;
static TimerSet l_Timers;
{
boost::mutex::scoped_lock lock(l_TimerMutex);
l_StopTimerThread = false;
- l_TimerThread = boost::thread(&Timer::TimerThreadProc);
+ l_TimerThread = std::thread(&Timer::TimerThreadProc);
}
/**
#include "base/objectlock.hpp"
#include <mmatch.h>
#include <boost/lexical_cast.hpp>
+#include <boost/thread/tss.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/trim.hpp>
if (!name) {
std::ostringstream idbuf;
- idbuf << boost::this_thread::get_id();
+ idbuf << std::this_thread::get_id();
return idbuf.str();
}
<< "'" << GetName() << "' started.";
- m_Thread = boost::thread(std::bind(&CheckerComponent::CheckThreadProc, this));
+ m_Thread = std::thread(std::bind(&CheckerComponent::CheckThreadProc, this));
m_ResultTimer = new Timer();
m_ResultTimer->SetInterval(5);
#include "base/configobject.hpp"
#include "base/timer.hpp"
#include "base/utility.hpp"
-#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/key_extractors.hpp>
+#include <thread>
namespace icinga
{
boost::mutex m_Mutex;
boost::condition_variable m_CV;
bool m_Stopped;
- boost::thread m_Thread;
+ std::thread m_Thread;
CheckableSet m_IdleCheckables;
CheckableSet m_PendingCheckables;
<< "'" << GetName() << "' started.";
#ifndef _WIN32
- m_CommandThread = boost::thread(std::bind(&ExternalCommandListener::CommandPipeThread, this, GetCommandPath()));
+ m_CommandThread = std::thread(std::bind(&ExternalCommandListener::CommandPipeThread, this, GetCommandPath()));
m_CommandThread.detach();
#endif /* _WIN32 */
}
#include "base/objectlock.hpp"
#include "base/timer.hpp"
#include "base/utility.hpp"
-#include <boost/thread/thread.hpp>
+#include <thread>
#include <iostream>
namespace icinga
private:
#ifndef _WIN32
- boost::thread m_CommandThread;
+ std::thread m_CommandThread;
void CommandPipeThread(const String& commandPath);
#endif /* _WIN32 */
#include "icinga/compatutility.hpp"
#include "base/timer.hpp"
#include "base/utility.hpp"
-#include <boost/thread/thread.hpp>
#include <iostream>
namespace icinga
m_Listener = socket;
- m_Thread = boost::thread(std::bind(&LivestatusListener::ServerThreadProc, this));
+ m_Thread = std::thread(std::bind(&LivestatusListener::ServerThreadProc, this));
Log(LogInformation, "LivestatusListener")
<< "Created TCP socket listening on host '" << GetBindHost() << "' port '" << GetBindPort() << "'.";
m_Listener = socket;
- m_Thread = boost::thread(std::bind(&LivestatusListener::ServerThreadProc, this));
+ m_Thread = std::thread(std::bind(&LivestatusListener::ServerThreadProc, this));
Log(LogInformation, "LivestatusListener")
<< "Created UNIX socket in '" << GetSocketPath() << "'.";
#include "livestatus/livestatuslistener.thpp"
#include "livestatus/livestatusquery.hpp"
#include "base/socket.hpp"
-#include <boost/thread/thread.hpp>
+#include <thread>
using namespace icinga;
void ClientHandler(const Socket::Ptr& client);
Socket::Ptr m_Listener;
- boost::thread m_Thread;
+ std::thread m_Thread;
};
}
return false;
}
- boost::thread thread(std::bind(&ApiListener::ListenerThreadProc, this, server));
+ std::thread thread(std::bind(&ApiListener::ListenerThreadProc, this, server));
thread.detach();
m_Servers.insert(server);
for (;;) {
try {
Socket::Ptr client = server->Accept();
- boost::thread thread(std::bind(&ApiListener::NewClientHandler, this, client, String(), RoleServer));
+ std::thread thread(std::bind(&ApiListener::NewClientHandler, this, client, String(), RoleServer));
thread.detach();
} catch (const std::exception&) {
Log(LogCritical, "ApiListener", "Cannot accept new connection.");
continue;
}
- boost::thread thread(std::bind(&ApiListener::AddConnection, this, endpoint));
+ std::thread thread(std::bind(&ApiListener::AddConnection, this, endpoint));
thread.detach();
}
}
#include "remote/httphandler.hpp"
#include "base/object.hpp"
#include "config/expression.hpp"
-#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
#include <set>