From 3e4284bb32b1515cdcac6741d2c2e94f64f08063 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Sat, 11 Jun 2016 23:45:23 +0000 Subject: MRA: change avatars load threads count default value from 4 to 1 add threads names git-svn-id: http://svn.miranda-ng.org/main/trunk@16948 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/IRCG/src/commandmonitor.cpp | 2 ++ protocols/IRCG/src/irclib.cpp | 5 +++++ protocols/IRCG/src/ircproto.cpp | 5 +++++ protocols/IRCG/src/scripting.cpp | 1 + protocols/IRCG/src/services.cpp | 4 ++++ 5 files changed, 17 insertions(+) (limited to 'protocols/IRCG/src') diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 22d1a408ae..fb7e734547 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -237,6 +237,7 @@ int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, TCHAR* msg) void __cdecl CIrcProto::ResolveIPThread(LPVOID di) { + Thread_SetName("IRC: ResolveIPThread"); IPRESOLVE* ipr = (IPRESOLVE *)di; { mir_cslock lock(m_resolve); @@ -2382,6 +2383,7 @@ bool CIrcProto::DoOnConnect(const CIrcMessage*) static void __cdecl AwayWarningThread(LPVOID) { + Thread_SetName("IRC: AwayWarningThread"); MessageBox(NULL, TranslateT("The usage of /AWAY in your perform buffer is restricted\n as IRC sends this command automatically."), TranslateT("IRC Error"), MB_OK); } diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index a78383f4a5..8d462b3a17 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -438,6 +438,7 @@ void CIrcProto::DoReceive() void __cdecl CIrcProto::ThreadProc(void*) { + Thread_SetName("IRC: CIrcProto"); DoReceive(); m_info.Reset(); } @@ -836,6 +837,8 @@ int CDccSession::Connect() void __cdecl CDccSession::ConnectProc(void *pparam) { + Thread_SetName("IRC: ConnectProc"); + CDccSession* pThis = (CDccSession*)pparam; if (!pThis->con) pThis->SetupConnection(); @@ -1039,6 +1042,8 @@ int CDccSession::IncomingConnection(HANDLE hConnection, DWORD dwIP) // here we decide which function to use for communicating with the remote computer, depending on connection type void __cdecl CDccSession::ThreadProc(void *pparam) { + Thread_SetName("IRC: CDccSession::ThreadProc"); + CDccSession* pThis = (CDccSession*)pparam; // if it is an incoming connection on a listening port, then we should close the listenting port so only one can connect (the one you offered diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 0f4caf2a54..4e5c156334 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -480,6 +480,8 @@ struct AckBasicSearchParam void __cdecl CIrcProto::AckBasicSearch(void *arg) { + Thread_SetName("IRC: AckBasicSearch"); + AckBasicSearchParam *param = (AckBasicSearchParam*)arg; PROTOSEARCHRESULT psr = { sizeof(psr) }; psr.flags = PSR_TCHAR; @@ -658,16 +660,19 @@ struct TFakeAckParam void __cdecl CIrcProto::AckMessageFail(void *info) { + Thread_SetName("IRC: AckMessageFail"); ProtoBroadcastAck((UINT_PTR)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The protocol is not online")); } void __cdecl CIrcProto::AckMessageFailDcc(void *info) { + Thread_SetName("IRC: AckMessageFailDcc"); ProtoBroadcastAck((UINT_PTR)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The dcc chat connection is not active")); } void __cdecl CIrcProto::AckMessageSuccess(void *info) { + Thread_SetName("IRC: AckMessageSuccess"); TFakeAckParam *param = (TFakeAckParam*)info; ProtoBroadcastAck(param->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)param->msgid, 0); delete param; diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp index a0c98d3298..b8cd6b6e7b 100644 --- a/protocols/IRCG/src/scripting.cpp +++ b/protocols/IRCG/src/scripting.cpp @@ -67,6 +67,7 @@ static void __stdcall OnHook(void * pi) static void __cdecl GuiOutThread(LPVOID di) { + Thread_SetName("IRC: GuiOutThread"); GCHOOK* gch = (GCHOOK*)di; CallFunctionAsync(OnHook, (void*)gch); } diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 19909dfc4b..d147b48b2e 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -976,6 +976,8 @@ int __cdecl CIrcProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) } void __cdecl CIrcProto::ConnectServerThread(void*) { + Thread_SetName("IRC: ConnectServer"); + InterlockedIncrement((long *)&m_bConnectThreadRunning); InterlockedIncrement((long *)&m_bConnectRequested); while (!Miranda_Terminated() && m_bConnectRequested > 0) { @@ -1016,6 +1018,8 @@ void __cdecl CIrcProto::ConnectServerThread(void*) void __cdecl CIrcProto::DisconnectServerThread(void*) { + Thread_SetName("IRC: DisconnectServer"); + mir_cslock lck(cs); if (IsConnected()) Disconnect(); -- cgit v1.2.3