mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-08 22:13:48 +01:00
add naming to threads
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
e2fcab34b7
commit
36473e3889
13 changed files with 38 additions and 8 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <thread>
|
||||
#include <pthread.h>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
|
@ -1312,6 +1313,7 @@ namespace http {
|
|||
|
||||
void HTTPServer::Run ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "Webconsole");
|
||||
while (m_IsRunning)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <boost/property_tree/ini_parser.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "Crypto.h"
|
||||
#include "FS.h"
|
||||
|
@ -131,6 +132,7 @@ namespace client
|
|||
|
||||
void I2PControlService::Run ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "I2PC");
|
||||
while (m_IsRunning)
|
||||
{
|
||||
try {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifdef USE_UPNP
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
|
@ -60,6 +61,7 @@ namespace transport
|
|||
|
||||
void UPnP::Run ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "UPnP");
|
||||
while (m_IsRunning)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
#include "Log.h"
|
||||
#include <pthread.h>
|
||||
|
||||
//for std::transform
|
||||
#include <algorithm>
|
||||
|
@ -179,6 +180,7 @@ namespace log {
|
|||
|
||||
void Log::Run ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "Logging");
|
||||
Reopen ();
|
||||
while (m_IsRunning)
|
||||
{
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include <inttypes.h>
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <array>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <vector>
|
||||
#include <boost/asio.hpp>
|
||||
#include <stdexcept>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "I2PEndian.h"
|
||||
#include "Base.h"
|
||||
|
@ -88,6 +89,8 @@ namespace data
|
|||
|
||||
void NetDb::Run ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "NetDB");
|
||||
|
||||
uint32_t lastSave = 0, lastPublish = 0, lastExploratory = 0, lastManageRequest = 0, lastDestinationCleanup = 0;
|
||||
while (m_IsRunning)
|
||||
{
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include "Log.h"
|
||||
#include "Timestamp.h"
|
||||
#include "RouterContext.h"
|
||||
|
@ -142,6 +143,8 @@ namespace transport
|
|||
|
||||
void SSUServer::Run ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "SSU");
|
||||
|
||||
while (m_IsRunning)
|
||||
{
|
||||
try
|
||||
|
@ -157,6 +160,8 @@ namespace transport
|
|||
|
||||
void SSUServer::RunReceivers ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "SSUv4");
|
||||
|
||||
while (m_IsRunning)
|
||||
{
|
||||
try
|
||||
|
@ -179,6 +184,8 @@ namespace transport
|
|||
|
||||
void SSUServer::RunReceiversV6 ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "SSUv6");
|
||||
|
||||
while (m_IsRunning)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <future>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <pthread.h>
|
||||
#include "Config.h"
|
||||
#include "Log.h"
|
||||
#include "I2PEndian.h"
|
||||
|
@ -148,6 +149,7 @@ namespace util
|
|||
|
||||
void NTPTimeSync::Run ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "Timesync");
|
||||
while (m_IsRunning)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* See full license text in LICENSE file at top of project tree
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
#include "Log.h"
|
||||
#include "Crypto.h"
|
||||
#include "RouterContext.h"
|
||||
|
@ -59,6 +60,8 @@ namespace transport
|
|||
template<typename Keys>
|
||||
void EphemeralKeysSupplier<Keys>::Run ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "Ephemerals");
|
||||
|
||||
while (m_IsRunning)
|
||||
{
|
||||
int num, total = 0;
|
||||
|
@ -272,6 +275,8 @@ namespace transport
|
|||
|
||||
void Transports::Run ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "Transports");
|
||||
|
||||
while (m_IsRunning && m_Service)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "I2PEndian.h"
|
||||
#include <random>
|
||||
#include <thread>
|
||||
#include <pthread.h>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include "Crypto.h"
|
||||
|
@ -472,6 +473,7 @@ namespace tunnel
|
|||
|
||||
void Tunnels::Run ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "Tunnels");
|
||||
std::this_thread::sleep_for (std::chrono::seconds(1)); // wait for other parts are ready
|
||||
|
||||
uint64_t lastTs = 0, lastPoolsTs = 0;
|
||||
|
|
|
@ -94,6 +94,7 @@ namespace util
|
|||
|
||||
void RunnableService::Run ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), m_Name.c_str());
|
||||
while (m_IsRunning)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -748,6 +748,7 @@ namespace client
|
|||
|
||||
void AddressBookSubscription::CheckUpdates ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "Addressbook");
|
||||
bool result = MakeRequest ();
|
||||
m_Book.DownloadComplete (result, m_Ident, m_Etag, m_LastModified);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
#include <cassert>
|
||||
#include <pthread.h>
|
||||
#include "Base.h"
|
||||
#include "Log.h"
|
||||
#include "Destination.h"
|
||||
|
@ -941,6 +942,7 @@ namespace client
|
|||
|
||||
void I2PUDPClientTunnel::TryResolving() {
|
||||
LogPrint(eLogInfo, "UDP Tunnel: Trying to resolve ", m_RemoteDest);
|
||||
pthread_setname_np(pthread_self(), "UDP Resolver");
|
||||
|
||||
std::shared_ptr<const Address> addr;
|
||||
while(!(addr = context.GetAddressBook().GetAddress(m_RemoteDest)) && !m_cancel_resolve)
|
||||
|
|
Loading…
Add table
Reference in a new issue