summaryrefslogtreecommitdiff
path: root/plugins/NotifyAnything/src/main.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-05-11 14:55:41 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-05-11 14:55:41 +0000
commit51ede24c4c00a3fe3f65139dd2522d78d5a1e55b (patch)
tree35427e53cffc8337c53843717b6de98289d57990 /plugins/NotifyAnything/src/main.cpp
parent1d6b7baa35f783765e78b6ffb1507c6c2884e359 (diff)
minus CreateThread
git-svn-id: http://svn.miranda-ng.org/main/trunk@13538 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NotifyAnything/src/main.cpp')
-rw-r--r--plugins/NotifyAnything/src/main.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp
index ee521e7550..35cc173008 100644
--- a/plugins/NotifyAnything/src/main.cpp
+++ b/plugins/NotifyAnything/src/main.cpp
@@ -845,7 +845,7 @@ void initWinsock()
}
}
-DWORD WINAPI udptcpThreadFunc(LPVOID useUdp)
+void __cdecl udptcpThreadFunc(void *useUdp)
{
try
{
@@ -883,7 +883,7 @@ DWORD WINAPI udptcpThreadFunc(LPVOID useUdp)
int err = recvfrom(sock, buf, sizeof buf - 1, 0, reinterpret_cast<sockaddr *>(&from), &fromSize);
if (g_exit_threads)
- return 0;
+ return;
if (err == SOCKET_ERROR)
throw "socket error";
@@ -901,7 +901,7 @@ DWORD WINAPI udptcpThreadFunc(LPVOID useUdp)
SOCKET msgsock = accept(sock, reinterpret_cast<sockaddr *>(&from), &fromSize);
if (g_exit_threads)
- return 0;
+ return;
if (msgsock == INVALID_SOCKET)
throw "socket error";
@@ -926,7 +926,7 @@ DWORD WINAPI udptcpThreadFunc(LPVOID useUdp)
processMessage((TCHAR*)_A2T(buf));
}
}
- return 0;
+ return;
}
catch (const char *err) {
std::string t = err;
@@ -949,16 +949,15 @@ DWORD WINAPI udptcpThreadFunc(LPVOID useUdp)
t += buf;
MessageBoxA(0, t.c_str(), Translate("Error"), MB_OK);
- return 1;
+ return;
}
}
void start_threads()
{
g_exit_threads = false;
- DWORD id;
- g_udp_thread = CreateThread(NULL, 0, udptcpThreadFunc, (void *)1, 0, &id);
- g_tcp_thread = CreateThread(NULL, 0, udptcpThreadFunc, NULL, 0, &id);
+ g_udp_thread = mir_forkthread(udptcpThreadFunc, (void *)1);
+ g_tcp_thread = mir_forkthread(udptcpThreadFunc, 0);
}
void stop_threads()