diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-09-14 19:34:42 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-09-14 19:34:42 +0000 |
commit | dda141f0798b79cfa71e78934ed1b968fcc20f53 (patch) | |
tree | 327942389d763f66201e47d49ad3253e0c0fe1d1 /protocols/Tox/src/tox_network.cpp | |
parent | 98a324d2fb4babc09e94a10fef819f3409477eb2 (diff) |
Tox: fixed tox thread management
git-svn-id: http://svn.miranda-ng.org/main/trunk@15354 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_network.cpp')
-rw-r--r-- | protocols/Tox/src/tox_network.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index 956378d9c4..0071d9b3f8 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -141,21 +141,9 @@ void CToxProto::CheckConnection(int &retriesCount) }
}
-void DoTox(ToxThreadData &toxThread)
-{
- {
- mir_cslock lock(toxThread.toxLock);
- tox_iterate(toxThread.tox);
- if (toxThread.toxAv)
- toxav_do(toxThread.toxAv);
- }
- uint32_t interval = tox_iteration_interval(toxThread.tox);
- Sleep(interval);
-}
-
void CToxProto::PollingThread(void*)
{
- ToxThreadData toxThread;
+ CToxThread toxThread;
this->toxThread = &toxThread;
logger->Log(__FUNCTION__": entering");
@@ -175,10 +163,10 @@ void CToxProto::PollingThread(void*) while (!toxThread.isTerminated)
{
CheckConnection(retriesCount);
- DoTox(toxThread);
+ toxThread.Do();
}
- UninitToxCore(&toxThread);
+ UninitToxCore();
toxThread.isConnected = false;
logger->Log(__FUNCTION__": leaving");
|