summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-09-09 22:24:07 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-09-09 22:24:07 +0300
commit23f0b751b57b2dd9f6e912cec92364ff59b864b2 (patch)
tree9b38146c3602b5300856d00bedfc248bce5c7da0 /protocols
parent77a3554616362939d78649fd257f65e464312e68 (diff)
fix for a crappy ::GetCurrentThread call that breaks all Wait* functions
Diffstat (limited to 'protocols')
-rw-r--r--protocols/EmLanProto/src/lan.cpp4
-rw-r--r--protocols/JabberG/src/jabber_console.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/protocols/EmLanProto/src/lan.cpp b/protocols/EmLanProto/src/lan.cpp
index 42787169d2..8d4d07dc53 100644
--- a/protocols/EmLanProto/src/lan.cpp
+++ b/protocols/EmLanProto/src/lan.cpp
@@ -146,7 +146,7 @@ void CLan::StartListen()
return;
}
- mir_forkthread(ListenProc, this);
+ m_hListenThread = mir_forkthread(ListenProc, this);
m_hAcceptTCPThread = mir_forkthread(AcceptTCPProc, this);
if (m_hListenThread == nullptr || m_hAcceptTCPThread == nullptr) {
m_mode = LM_ON;
@@ -179,7 +179,7 @@ void CLan::Listen()
if (m_mode != LM_LISTEN)
return;
- MThreadHandle threadLock(m_hListenThread);
+ MThreadLock threadLock(m_hListenThread);
mir_ptr<char> buf((char*)mir_alloc(65536));
while (true) {
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 276b3b8f45..94a9fc9c95 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -571,7 +571,7 @@ public:
void __cdecl CJabberProto::ConsoleThread(void*)
{
Thread_SetName("Jabber: ConsoleThread");
- MThreadHandle threadLock(m_hThreadConsole);
+ MThreadLock threadLock(m_hThreadConsole);
m_dwConsoleThreadId = ::GetCurrentThreadId();
m_pDlgConsole = new CJabberDlgConsole(this);
@@ -607,7 +607,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleConsole(WPARAM, LPARAM)
if (m_pDlgConsole)
SetForegroundWindow(m_pDlgConsole->GetHwnd());
else
- ForkThread(&CJabberProto::ConsoleThread);
+ m_hThreadConsole = ForkThreadEx(&CJabberProto::ConsoleThread, 0, &m_dwConsoleThreadId);
return 0;
}