summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_thread.h
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-03-15 00:19:35 +0300
committeraunsane <aunsane@gmail.com>2017-03-15 00:19:35 +0300
commit5de53491d607c38286b19989ba7182454f24fabc (patch)
treecb0da96d057fd1f85245ca3ff3423ea3300da060 /protocols/Tox/src/tox_thread.h
parenta76c706113f6d9e1a1a253feab46051fb2e6ce12 (diff)
Tox:
- tox_network.cpp splitted on two logical parts - tox network status checking moved to separated thread - started rejection of toxThread wrapper
Diffstat (limited to 'protocols/Tox/src/tox_thread.h')
-rw-r--r--protocols/Tox/src/tox_thread.h54
1 files changed, 2 insertions, 52 deletions
diff --git a/protocols/Tox/src/tox_thread.h b/protocols/Tox/src/tox_thread.h
index a60d0246e3..ae0f4225f8 100644
--- a/protocols/Tox/src/tox_thread.h
+++ b/protocols/Tox/src/tox_thread.h
@@ -6,16 +6,10 @@ class CToxThread
private:
Tox *tox;
ToxAV *toxAV;
- bool isConnected;
- bool isTerminated;
-
- mir_cs toxLock;
-
- mir_cs lock;
public:
- CToxThread(Tox_Options *options, TOX_ERR_NEW *error = NULL) : tox(NULL), toxAV(NULL),
- isConnected(false), isTerminated(false)
+ CToxThread(Tox_Options *options, TOX_ERR_NEW *error = NULL)
+ : tox(NULL), toxAV(NULL)
{
tox = tox_new(options, error);
}
@@ -35,11 +29,6 @@ public:
}
}
- mir_cslock Lock()
- {
- return mir_cslock(lock);
- }
-
Tox* Tox()
{
return tox;
@@ -49,45 +38,6 @@ public:
{
return toxAV;
}
-
- bool IsConnected() const
- {
- return tox && isConnected;
- }
-
- void Connect()
- {
- Lock();
-
- isConnected = true;
- }
-
- void Disconnect()
- {
- Lock();
-
- isConnected = false;
- }
-
- void Iterate(void* data)
- {
- {
- mir_cslock lock(toxLock);
- tox_iterate(tox, data);
- //if (toxAV)
- // toxav_iterate(toxAV);
- }
- uint32_t interval = tox_iteration_interval(tox);
- interval = interval ? interval : 50;
- Sleep(interval);
- }
-
- bool IsTerminated() const
- {
- return !tox || isTerminated;
- }
-
- void Stop() { isTerminated = true; }
};
#endif //_TOX_THREAD_H_ \ No newline at end of file