Join to Android JVM from the worker thread

This commit is contained in:
Constantin Shalnev 2015-08-04 20:12:39 +03:00 committed by Alex Zolotarev
parent a37bd5801e
commit a44d56c751

View file

@ -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()