Calling attach multiple times doesnt directly cause problems but if
you call detach then the thread will immediately detach. For example
this code will not work correctly:
void f1()
{
AttachCurrentThread();
//call jni function
DetachCurrentThread();
}
void f2()
{
AttachCurrentThread();
//call jni function
f1();
//calling jni functions here will not work
DetachCurrentThread();
> On Thu, Jul 15, 2010 at 00:23, Lee Leclair <
zer0stimu...@gmail.com> wrote:
> > Is it safe to invoke AttachCurrentThread() multiple times from the
> > same native thread? In other words, after the first invocation, will
> > subsequent invocations be no-opts or will they be problematic.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-ndk" group.
> > To post to this group, send email to
andro...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
android-ndk...@googlegroups.com<
android-ndk%2Bunsu...@googlegroups.com>
> > .