diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2016-06-11 23:45:23 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2016-06-11 23:45:23 +0000 |
commit | 3e4284bb32b1515cdcac6741d2c2e94f64f08063 (patch) | |
tree | 15602d9e534406646b4b10c889809e10ff07ef30 /plugins | |
parent | f36117c31cd21ba5442be8fd1d7234b1e71380b2 (diff) |
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
Diffstat (limited to 'plugins')
24 files changed, 87 insertions, 29 deletions
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 01e3c65a23..57f78e88a3 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -213,6 +213,8 @@ int SetAvatarAttribute(MCONTACT hContact, DWORD attrib, int mode) void PicLoader(LPVOID)
{
+ Thread_SetName("AVS: PicLoader");
+
DWORD dwDelay = db_get_dw(NULL, AVS_MODULE, "picloader_sleeptime", 80);
if (dwDelay < 30)
diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp index 38d09b75e6..a713a71935 100644 --- a/plugins/AVS/src/poll.cpp +++ b/plugins/AVS/src/poll.cpp @@ -208,6 +208,8 @@ int FetchAvatarFor(MCONTACT hContact, char *szProto) static void RequestThread(void *)
{
+ Thread_SetName("AVS: RequestThread");
+
while (!g_shutDown) {
mir_cslockfull lck(cs);
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index 3be64cf8df..50f6134e31 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -799,6 +799,8 @@ INT_PTR GetMyAvatar(WPARAM wParam, LPARAM lParam) static void ReloadMyAvatar(LPVOID lpParam)
{
+ Thread_SetName("AVS: ReloadMyAvatar");
+
char *szProto = (char *)lpParam;
mir_sleep(500);
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index ad46597c14..cd8a3d8f93 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -105,6 +105,8 @@ extern TCHAR g_ptszEventName[]; void MF_UpdateThread(LPVOID)
{
+ Thread_SetName("CList_nicer: MF_UpdateThread");
+
HANDLE hEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, g_ptszEventName);
WaitForSingleObject(hEvent, 20000);
diff --git a/plugins/HistoryStats/src/statistic.cpp b/plugins/HistoryStats/src/statistic.cpp index d0b349934b..9bcdaaa201 100644 --- a/plugins/HistoryStats/src/statistic.cpp +++ b/plugins/HistoryStats/src/statistic.cpp @@ -1370,6 +1370,8 @@ bool Statistic::createStatisticsSteps() void __cdecl Statistic::threadProc(void *lpParameter)
{
+ Thread_SetName("HistoryStats: Statistic::threadProc");
+
Statistic* pStats = reinterpret_cast<Statistic*>(lpParameter);
SetEvent(pStats->m_hThreadPushEvent);
@@ -1388,6 +1390,7 @@ void __cdecl Statistic::threadProc(void *lpParameter) void __cdecl Statistic::threadProcSteps(void *lpParameter)
{
+ Thread_SetName("HistoryStats: Statistic::threadProcSteps");
Statistic* pStats = reinterpret_cast<Statistic*>(lpParameter);
if (pStats->m_Settings.m_ThreadLowPriority)
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index af392241d3..54d1992fbb 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -273,6 +273,8 @@ static void __cdecl FlashThreadFunction(void*) BOOL bEvent = FALSE;
DWORD dwEventStarted = 0, dwFlashStarted = 0;
BYTE data, unchangedLeds;
+
+ Thread_SetName("KeyboardNotify: FlashThreadFunction");
while (TRUE) {
unchangedLeds = (BYTE)(LedState(VK_PAUSE) * !bFlashLed[2] + ((LedState(VK_NUMLOCK) * !bFlashLed[0]) << 1) + ((LedState(VK_CAPITAL) * !bFlashLed[1]) << 2));
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index 752e004b15..c08508db61 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -30,6 +30,8 @@ HANDLE g_hUpdateMsgsThread = NULL; void __cdecl UpdateMsgsThreadProc(void *)
{
+ Thread_SetName("NewAwaySysMod: UpdateMsgsThreadProc");
+
int numAccs;
PROTOACCOUNT **accs;
Proto_EnumAccounts(&numAccs, &accs);
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index 50da664b4e..6b8d51228f 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -50,6 +50,8 @@ public: // _ad must be allocated using "new CAutoreplyData()"
void __cdecl AutoreplyDelayThread(void *_ad)
{
+ Thread_SetName("NewAwaySysMod: AutoreplyDelayThread");
+
CAutoreplyData *ad = (CAutoreplyData*)_ad;
_ASSERT(ad && ad->hContact && ad->Reply.GetLen());
char *szProto = GetContactProto(ad->hContact);
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index 6f15fc8024..6ad434754f 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -34,6 +34,8 @@ static void SelectAll(HWND hDlg, bool bEnable) static void ApplyDownloads(void *param)
{
+ Thread_SetName("PluginUpdater: ApplyDownloads");
+
HWND hDlg = (HWND)param;
//////////////////////////////////////////////////////////////////////////////////////
@@ -376,6 +378,8 @@ static FILEINFO* ServerEntryToFileInfo(const ServListEntry &hash, const TCHAR* t //
static void GetList(void *)
{
+ Thread_SetName("PluginUpdater: GetList");
+
TCHAR tszTempPath[MAX_PATH];
DWORD dwLen = GetTempPath(_countof(tszTempPath), tszTempPath);
if (tszTempPath[dwLen-1] == '\\')
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 98256b7e56..d4b4ce1e7d 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -43,6 +43,8 @@ static void SetStringText(HWND hWnd, size_t i, TCHAR *ptszText) static void ApplyUpdates(void *param)
{
+ Thread_SetName("PluginUpdater: ApplyUpdates");
+
HWND hDlg = (HWND)param;
OBJLIST<FILEINFO> &todo = *(OBJLIST<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
if (todo.getCount() == 0) {
@@ -380,6 +382,8 @@ static INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM static void DlgUpdateSilent(void *param)
{
+ Thread_SetName("PluginUpdater: DlgUpdateSilent");
+
OBJLIST<FILEINFO> &UpdateFiles = *(OBJLIST<FILEINFO> *)param;
if (UpdateFiles.getCount() == 0) {
delete &UpdateFiles;
@@ -767,6 +771,8 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tsz static void CheckUpdates(void *)
{
Netlib_LogfT(hNetlibUser, _T("Checking for updates"));
+ Thread_SetName("PluginUpdater: CheckUpdates");
+
TCHAR tszTempPath[MAX_PATH];
DWORD dwLen = GetTempPath(_countof(tszTempPath), tszTempPath);
if (tszTempPath[dwLen - 1] == '\\')
@@ -887,6 +893,7 @@ void InitTimer(void *type) {
if (!opts.bUpdateOnPeriod)
return;
+ Thread_SetName("PluginUpdater: InitTimer");
LONGLONG interval;
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index eff60a4523..0a0c468aaa 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -211,6 +211,8 @@ static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARA // thread func
static unsigned __stdcall PopupThread(void *)
{
+ Thread_SetName("Popup: PopupThread");
+
// Create manager window
DWORD err;
WNDCLASSEX wcl;
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index d48670cef7..9420cf4e77 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -1258,6 +1258,8 @@ LRESULT CALLBACK PopupWnd2::WindowProc(HWND hwnd, UINT message, WPARAM wParam, L void WindowThread(void *arg)
{
+ Thread_SetName("POPUP: WindowThread");
+
CoInitialize(NULL); // we may need OLE in this thread for smiley substitution
PopupWnd2 *wnd = (PopupWnd2 *)arg;
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 204bfe5c7d..cfb41abe37 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -1035,6 +1035,8 @@ int GetTextPixelSize(TCHAR* pszText, HFONT hFont, BOOL bWidth) static void __cdecl phase2(void *lParam)
{
+ Thread_SetName("Scriver: phase2");
+
SESSION_INFO *si = (SESSION_INFO*)lParam;
Sleep(30);
if (si && si->hWnd)
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 08826a6b51..f902e34484 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -507,6 +507,8 @@ void myPlaySound(MCONTACT hcontact, WORD newStatus, WORD oldStatus) // will add hContact to queue and will return position;
static void waitThread(void *param)
{
+ Thread_SetName("SeenPlugin: waitThread");
+
logthread_info* infoParam = (logthread_info*)param;
WORD prevStatus = db_get_w(infoParam->hContact, S_MOD, "StatusTriger", ID_STATUS_OFFLINE);
@@ -636,6 +638,8 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) static void cleanThread(void *param)
{
+ Thread_SetName("SeenPlugin: cleanThread");
+
logthread_info* infoParam = (logthread_info*)param;
char *szProto = infoParam->sProtoName;
diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp index f0f052b416..5c39cc3844 100644 --- a/plugins/SmileyAdd/src/download.cpp +++ b/plugins/SmileyAdd/src/download.cpp @@ -124,6 +124,8 @@ bool InternetDownloadFile(const char *szUrl, char *szDest, HANDLE &hHttpDwnl) void __cdecl SmileyDownloadThread(void*)
{
+ Thread_SetName("SmileyAdd: SmileyDownloadThread");
+
bool needext = false;
HANDLE hHttpDwnl = NULL;
WaitForSingleObject(g_hDlMutex, 3000);
diff --git a/plugins/SmileyAdd/src/smltool.cpp b/plugins/SmileyAdd/src/smltool.cpp index d297b8eb26..c310abdbd6 100644 --- a/plugins/SmileyAdd/src/smltool.cpp +++ b/plugins/SmileyAdd/src/smltool.cpp @@ -713,6 +713,8 @@ int SmileyToolWindowType::CalculateCoordinatesToButton(POINT pt, int scroll) void __cdecl SmileyToolThread(void *arg)
{
+ Thread_SetName("SmileyAdd: SmileyToolThread");
+
SmileyToolWindowParam *stwp = (SmileyToolWindowParam*)arg;
if (stwp->pSmileyPack && stwp->pSmileyPack->VisibleSmileyCount()) {
WNDCLASSEX wndclass;
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index 084297eb78..abe47b5afb 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -223,38 +223,40 @@ void IsMenu() static INT_PTR AdvSt()
{
- if ((Enabled == 1)){
- POPUPDATAT ppd = {0};
- TCHAR * lptzText =L"";
- db_set_b(NULL, "Skin", "UseSound", 0);
- EnablePopupModule();
-
- if (PopUp == 1) {
- lptzText = NonStatusAllow == 1 ? ALL_DISABLED_FLT : ALL_DISABLED;
- ppd.lchIcon = IcoLib_GetIconByHandle((NonStatusAllow == 1) ? GetIconHandle(ALL_ENABLED_FLT) : GetIconHandle(MENU_NAME));
- ppd.lchContact = NULL;
- ppd.iSeconds = PopUpTime;
- wcsncpy_s(ppd.lptzText, lptzText, _TRUNCATE);
- lptzText = TranslateT(MENU_NAME);
- wcsncpy_s(ppd.lptzContactName, lptzText, _TRUNCATE);
- PUAddPopupT(&ppd);
- }
+ Thread_SetName("StartupSilenc: AdvSt");
- timer = 2;
- Sleep(delay * 1000);
- timer = 0;
+ if ((Enabled == 1)) {
+ POPUPDATAT ppd = {0};
+ TCHAR * lptzText =L"";
+ db_set_b(NULL, "Skin", "UseSound", 0);
+ EnablePopupModule();
+
+ if (PopUp == 1) {
+ lptzText = NonStatusAllow == 1 ? ALL_DISABLED_FLT : ALL_DISABLED;
+ ppd.lchIcon = IcoLib_GetIconByHandle((NonStatusAllow == 1) ? GetIconHandle(ALL_ENABLED_FLT) : GetIconHandle(MENU_NAME));
+ ppd.lchContact = NULL;
+ ppd.iSeconds = PopUpTime;
+ wcsncpy_s(ppd.lptzText, lptzText, _TRUNCATE);
+ lptzText = TranslateT(MENU_NAME);
+ wcsncpy_s(ppd.lptzContactName, lptzText, _TRUNCATE);
+ PUAddPopupT(&ppd);
+ }
- if (PopUp == 1) {
- lptzText = (DefEnabled == 1 && DefPopup == 1) ? TranslateT(ALL_ENABLED_FLT) : ALL_ENABLED;
- ppd.lchIcon = IcoLib_GetIconByHandle((DefEnabled == 1 && DefPopup == 1) ? GetIconHandle(ALL_ENABLED_FLT) : GetIconHandle(MENU_NAME));
- wcsncpy_s(ppd.lptzText, lptzText, _TRUNCATE);
- PUAddPopupT(&ppd);
- }
- if (DefEnabled == 1) { //predefined sound setting
- db_set_b(NULL, "Skin", "UseSound", DefSound);
- }
- else db_set_b(NULL, "Skin", "UseSound", 1); //or enable sounds every starts
+ timer = 2;
+ Sleep(delay * 1000);
+ timer = 0;
+
+ if (PopUp == 1) {
+ lptzText = (DefEnabled == 1 && DefPopup == 1) ? TranslateT(ALL_ENABLED_FLT) : ALL_ENABLED;
+ ppd.lchIcon = IcoLib_GetIconByHandle((DefEnabled == 1 && DefPopup == 1) ? GetIconHandle(ALL_ENABLED_FLT) : GetIconHandle(MENU_NAME));
+ wcsncpy_s(ppd.lptzText, lptzText, _TRUNCATE);
+ PUAddPopupT(&ppd);
}
+ if (DefEnabled == 1) { //predefined sound setting
+ db_set_b(NULL, "Skin", "UseSound", DefSound);
+ }
+ else db_set_b(NULL, "Skin", "UseSound", 1); //or enable sounds every starts
+ }
return 0;
}
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index c72083e891..017b1d07de 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -751,6 +751,8 @@ static VOID CALLBACK AfterCheckTimer(HWND, UINT, UINT_PTR, DWORD) static void CheckContinueslyFunction(void *) { + Thread_SetName("KeepStatus: CheckContinueslyFunction"); + static int pingFailures = 0; // one at the time is enough, do it the 'easy' way diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index eab7d769d2..5ecd96eeed 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -1709,6 +1709,8 @@ int GetTextPixelSize(TCHAR* pszText, HFONT hFont, bool bWidth) static void __cdecl phase2(void * lParam) { + Thread_SetName("TabSRMM: phase2"); + SESSION_INFO *si = (SESSION_INFO*)lParam; Sleep(30); if (si && si->hWnd) diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index be944454c7..249134d490 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -978,6 +978,8 @@ void TSAPI DM_ScrollToBottom(TWindowData *dat, WPARAM wParam, LPARAM lParam) static void LoadKLThread(LPVOID _param) { + Thread_SetName("TabSRMM: LoadKLThread"); + DBVARIANT dbv; if (!db_get_ts((UINT_PTR)_param, SRMSGMOD_T, "locale", &dbv)) { HKL hkl = LoadKeyboardLayout(dbv.ptszVal, 0); diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 345bed18f0..428883a1da 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -119,6 +119,8 @@ entry_found: static void DoSplitSendA(LPVOID param) { + Thread_SetName("TabSRMM: DoSplitSendA"); + SendJob *job = sendQueue->getJobByIndex((INT_PTR)param); size_t iLen = mir_strlen(job->szSendBuffer); diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index b3bb79db7f..caf9715dee 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -37,6 +37,8 @@ static TCHAR g_eventName[100]; static void TrayAnimThread(LPVOID)
{
+ Thread_SetName("TabSRMM: TrayAnimThread");
+
int iAnimMode = (PluginConfig.m_AnimTrayIcons[0] && PluginConfig.m_AnimTrayIcons[1] && PluginConfig.m_AnimTrayIcons[2] &&
PluginConfig.m_AnimTrayIcons[3]);
DWORD dwElapsed = 0, dwAnimStep = 0;
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index 949d5d9603..6f6f8d47ef 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -101,6 +101,8 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex) unsigned int CALLBACK MessagePumpThread(void*)
{
+ Thread_SetName("TipperYM: MessagePumpThread");
+
HWND hwndTip = NULL;
CLCINFOTIPEX *clcitex = NULL;
MSG hwndMsg = {0};
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp index e541836bbf..46a8a173a6 100644 --- a/plugins/WhenWasIt/src/services.cpp +++ b/plugins/WhenWasIt/src/services.cpp @@ -189,6 +189,8 @@ void ShowPopupMessage(const TCHAR *title, const TCHAR *message, HANDLE icon) void __cdecl RefreshUserDetailsWorkerThread(void*)
{
+ Thread_SetName("WhenWasIt: RefreshUserDetailsWorkerThread");
+
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Starting to refresh user details"), hRefreshUserDetails);
int delay = db_get_w(NULL, ModuleName, "UpdateDelay", REFRESH_DETAILS_DELAY);
|