-
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
category: jniJNI-related tasksJNI-related tasksgood first issueGood for newcomersGood for newcomershelp wantedContributions are welcomeContributions are welcome
Description
Actually we are calling AttachCurrentThread and DetachCurrentThread inside the logger_handler function (https://github.com/roc-project/roc-java/blob/master/roc_jni/src/main/cpp/logger.cpp);
As it has been discussed at #18 this can slow down performances.
A more efficient solution would involve detaching thread just before its exit, as it's described at https://developer.android.com/training/articles/perf-jni#threads:
you can use
pthread_key_create()to define a destructor function that will be called before the thread exits, and callDetachCurrentThread()from there. (Use that key withpthread_setspecific()to store theJNIEnvin thread-local-storage).
Metadata
Metadata
Assignees
Labels
category: jniJNI-related tasksJNI-related tasksgood first issueGood for newcomersGood for newcomershelp wantedContributions are welcomeContributions are welcome