public void registerIfNeeded(String name) {
if (mEndpoint.libIsThreadRegistered()) return;
try {
Logger.debug("----------------- Registering thread. ------------");
if (TextUtils.isEmpty(name)) name = this.getClass().getName();
mEndpoint.libRegisterThread(name);
} catch (Exception e) {
Logger.error("Unable to register thread ", e);
}
}
Now What I don't understand is that sometimes it works but most of the times I get the same error again. There must
be something that I am doing wrong. Please help me guys.
Before calling any PJ API in the same function register thread by giving call to
status = pj_thread_register("ABCD", calling_thread_desc,
&pj_thread);
This usually works in C, C++ environment.