Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantin Shalnev <c.shalnev@corp.mail.ru>2015-08-05 15:59:26 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:59:18 +0300
commit383627e23c4eb5178513376e48113d6d6e9a048f (patch)
tree955409cc957bdb4f022d462b87dd2b5aa23f9402 /routing
parent230224bf82ad8f65051476f7331f181f85f8f1c2 (diff)
Use SimpleThread
Diffstat (limited to 'routing')
-rw-r--r--routing/async_router.cpp15
-rw-r--r--routing/async_router.hpp5
2 files changed, 4 insertions, 16 deletions
diff --git a/routing/async_router.cpp b/routing/async_router.cpp
index 453a2fb6cd..1db36e526b 100644
--- a/routing/async_router.cpp
+++ b/routing/async_router.cpp
@@ -9,11 +9,6 @@
#include "indexer/mercator.hpp"
-#if defined(OMIM_OS_ANDROID)
-void AndroidThreadAttachToJVM();
-void AndroidThreadDetachFromJVM();
-#endif // defined(OMIM_OS_ANDROID)
-
namespace routing
{
@@ -124,7 +119,7 @@ AsyncRouter::AsyncRouter(TRoutingStatisticsCallback const & routingStatisticsCal
m_routingStatisticsCallback(routingStatisticsCallback),
m_pointCheckCallback(pointCheckCallback)
{
- m_thread = thread(bind(&AsyncRouter::ThreadFunc, this));
+ m_thread = threads::SimpleThread(&AsyncRouter::ThreadFunc, this);
}
AsyncRouter::~AsyncRouter()
@@ -234,10 +229,6 @@ void AsyncRouter::ResetDelegate()
void AsyncRouter::ThreadFunc()
{
-#if defined(OMIM_OS_ANDROID)
- AndroidThreadAttachToJVM();
-#endif // defined(OMIM_OS_ANDROID)
-
while (true)
{
{
@@ -250,10 +241,6 @@ void AsyncRouter::ThreadFunc()
CalculateRoute();
}
-
-#if defined(OMIM_OS_ANDROID)
- AndroidThreadDetachFromJVM();
-#endif // defined(OMIM_OS_ANDROID)
}
void AsyncRouter::CalculateRoute()
diff --git a/routing/async_router.hpp b/routing/async_router.hpp
index a290e8702b..beb75ab254 100644
--- a/routing/async_router.hpp
+++ b/routing/async_router.hpp
@@ -5,12 +5,13 @@
#include "router.hpp"
#include "router_delegate.hpp"
+#include "base/thread.hpp"
+
#include "std/condition_variable.hpp"
#include "std/map.hpp"
#include "std/mutex.hpp"
#include "std/shared_ptr.hpp"
#include "std/string.hpp"
-#include "std/thread.hpp"
#include "std/unique_ptr.hpp"
namespace routing
@@ -103,7 +104,7 @@ private:
mutex m_guard;
/// Thread which executes routing calculation
- thread m_thread;
+ threads::SimpleThread m_thread;
condition_variable m_threadCondVar;
bool m_threadExit;
bool m_hasRequest;