|
|
|
@@ -290,13 +290,23 @@ public: |
|
|
|
if (android.activity != nullptr)
|
|
|
|
{
|
|
|
|
jvm->DetachCurrentThread();
|
|
|
|
removeCurrentThreadFromCache();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void removeCurrentThreadFromCache()
|
|
|
|
{
|
|
|
|
const pthread_t thisThread = pthread_self();
|
|
|
|
|
|
|
|
const pthread_t thisThread = pthread_self();
|
|
|
|
SpinLock::ScopedLockType sl (addRemoveLock);
|
|
|
|
|
|
|
|
SpinLock::ScopedLockType sl (addRemoveLock);
|
|
|
|
for (int i = 0; i < maxThreads; ++i)
|
|
|
|
if (threads[i] == thisThread)
|
|
|
|
threads[i] = 0;
|
|
|
|
for (int i = 0; i < maxThreads; ++i)
|
|
|
|
{
|
|
|
|
if (threads[i] == thisThread)
|
|
|
|
{
|
|
|
|
threads[i] = 0;
|
|
|
|
envs[i] = nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|