diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2017-08-11 10:11:18 +0300 |
---|---|---|
committer | Yuri Gorshenin <mipt.vi002@gmail.com> | 2017-08-11 15:28:38 +0300 |
commit | 36c77a60fb00655ce4d51797b512c54fa593cf6d (patch) | |
tree | 0d3c9e1f32720fec58c92ea82fda6bf2ecefa1cd /platform | |
parent | b5d67594ae945aad7a2c1cc1aad297db434f028f (diff) |
[platform] single thread for network tasks is added
Diffstat (limited to 'platform')
-rw-r--r-- | platform/platform.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/platform.hpp b/platform/platform.hpp index 0b5c48e715..d6a01b7b9e 100644 --- a/platform/platform.hpp +++ b/platform/platform.hpp @@ -8,6 +8,7 @@ #include "base/exception.hpp" #include "base/task_loop.hpp" +#include "base/worker_thread.hpp" #include "std/bitset.hpp" #include "std/function.hpp" @@ -96,6 +97,8 @@ protected: unique_ptr<base::TaskLoop> m_guiThread; + base::WorkerThread m_networkThread; + public: Platform(); virtual ~Platform() = default; @@ -197,6 +200,9 @@ public: void RunOnGuiThread(base::TaskLoop::Task && task); void RunOnGuiThread(base::TaskLoop::Task const & task); + template <typename Task> + void RunOnNetworkThread(Task && task) { m_networkThread.Push(forward<Task>(task)); } + enum Priority { EPriorityBackground, |