diff options
author | Constantin Shalnev <c.shalnev@corp.mail.ru> | 2015-08-04 20:12:39 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:59:04 +0300 |
commit | a44d56c751326ff908fd992f1c2798bf2b6efd27 (patch) | |
tree | cbc710c2e934b52f33632f7999dd8ff8301133fd /routing | |
parent | a37bd5801e9441da3767e0dc81558e8577c80dd7 (diff) |
Join to Android JVM from the worker thread
Diffstat (limited to 'routing')
-rw-r--r-- | routing/async_router.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/routing/async_router.cpp b/routing/async_router.cpp index 8a66dc7726..75d5dc4d09 100644 --- a/routing/async_router.cpp +++ b/routing/async_router.cpp @@ -9,6 +9,11 @@ #include "indexer/mercator.hpp" +#if defined(OMIM_OS_ANDROID) +void AndroidThreadAttachToJVM(); +void AndroidThreadDetachFromJVM(); +#endif // defined(OMIM_OS_ANDROID) + namespace routing { @@ -223,6 +228,10 @@ void AsyncRouter::ResetDelegate() void AsyncRouter::ThreadFunc() { +#if defined(OMIM_OS_ANDROID) + AndroidThreadAttachToJVM(); +#endif // defined(OMIM_OS_ANDROID) + while (true) { { @@ -235,6 +244,10 @@ void AsyncRouter::ThreadFunc() CalculateRoute(); } + +#if defined(OMIM_OS_ANDROID) + AndroidThreadDetachFromJVM(); +#endif // defined(OMIM_OS_ANDROID) } void AsyncRouter::CalculateRoute() |