summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/EmLanProto/src/lan.cpp4
-rw-r--r--protocols/JabberG/src/jabber_console.cpp3
2 files changed, 5 insertions, 2 deletions
diff --git a/protocols/EmLanProto/src/lan.cpp b/protocols/EmLanProto/src/lan.cpp
index 157470f2b0..deff7edd18 100644
--- a/protocols/EmLanProto/src/lan.cpp
+++ b/protocols/EmLanProto/src/lan.cpp
@@ -146,7 +146,7 @@ void CLan::StartListen()
return;
}
- m_hListenThread = mir_forkthread(ListenProc, this);
+ mir_forkthread(ListenProc, this);
m_hAcceptTCPThread = mir_forkthread(AcceptTCPProc, this);
if (m_hListenThread == nullptr || m_hAcceptTCPThread == nullptr) {
m_mode = LM_ON;
@@ -176,6 +176,8 @@ void __cdecl CLan::ListenProc(void *lpParameter)
void CLan::Listen()
{
+ MThreadHandle threadLock(m_hListenThread);
+
if (m_mode == LM_LISTEN) {
char buf[65536];
while (true) {
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 4e7a1e05bb..7a03299590 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -571,6 +571,7 @@ public:
void __cdecl CJabberProto::ConsoleThread(void*)
{
Thread_SetName("Jabber: ConsoleThread");
+ MThreadHandle threadLock(m_hThreadConsole);
MSG msg;
while (GetMessage(&msg, nullptr, 0, 0)) {
@@ -588,7 +589,7 @@ void __cdecl CJabberProto::ConsoleThread(void*)
void CJabberProto::ConsoleInit()
{
- m_hThreadConsole = ForkThreadEx(&CJabberProto::ConsoleThread, nullptr, &m_dwConsoleThreadId);
+ ForkThreadEx(&CJabberProto::ConsoleThread, nullptr, &m_dwConsoleThreadId);
}
void CJabberProto::ConsoleUninit()