1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-16 00:34:19 +00:00

For for hi-res timer threads on android.

This commit is contained in:
jules 2014-07-31 09:00:37 +01:00
parent e233124fc3
commit 6bb3a4b74f
2 changed files with 9 additions and 7 deletions

View file

@ -362,6 +362,12 @@ private:
extern ThreadLocalJNIEnvHolder threadLocalJNIEnvHolder;
struct AndroidThreadScope
{
AndroidThreadScope() { threadLocalJNIEnvHolder.attach(); }
~AndroidThreadScope() { threadLocalJNIEnvHolder.detach(); }
};
//==============================================================================
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \
METHOD (createNewView, "createNewView", "(ZJ)L" JUCE_ANDROID_ACTIVITY_CLASSPATH "$ComponentPeerView;") \

View file

@ -837,12 +837,6 @@ extern "C" void* threadEntryProc (void* userData)
JUCE_AUTORELEASEPOOL
{
#if JUCE_ANDROID
struct AndroidThreadScope
{
AndroidThreadScope() { threadLocalJNIEnvHolder.attach(); }
~AndroidThreadScope() { threadLocalJNIEnvHolder.detach(); }
};
const AndroidThreadScope androidEnv;
#endif
@ -1184,7 +1178,9 @@ private:
static void* timerThread (void* param)
{
#if ! JUCE_ANDROID
#if JUCE_ANDROID
const AndroidThreadScope androidEnv;
#else
int dummy;
pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, &dummy);
#endif