-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android optimization for Attach/Detach from C callbacks #243
Conversation
5bd9451
to
198d2d6
Compare
I tested this on my Android device and it works as expected. |
198d2d6
to
755bcfa
Compare
Looks good, thanks!! Although I'm not sure I see why the lock is needed... Anyway, let's prefix the |
I think the lock is needed around the getspecific/setspecific. Renaming the statics makes sense, I can do that. |
That's what I'm thinking, or maybe the Yes, please change the names, thanks! |
The pthread_once likely does not need to be inside the lock, though it was in the ffmpeg code I copied from. The lock is needed around the get/set only, since that's two separate operations that could race. |
This is a thread-specific variable, there can't be any race conditions. There must be some other reason though. |
755bcfa
to
518201a
Compare
Done. |
cc @mbouron in case he remembers the reason for the lock |
I think pthread mutex in ffmpeg is used to protect In javacpp, |
fixes #242