forked from organicmaps/organicmaps
Join to Android JVM from the worker thread
This commit is contained in:
parent
a37bd5801e
commit
a44d56c751
1 changed files with 13 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue