cdmf-agent-android icon indicating copy to clipboard operation
cdmf-agent-android copied to clipboard

IdentityProxy is not thread safe ?

Open yhilem opened this issue 7 years ago • 3 comments

Hi, I noticed that IdProxy can be called from APIController.invokeAPI in different contexts (threads). Setting requestcode for singleton IdentityProxy is not thread safe : IdentityProxy.getInstance().setRequestCode(requestCode);

Please tell us if assigning a value to this requestCode attribute in a multithreaded context could or not produce an inconsistent result?

yhilem avatar Mar 26 '17 14:03 yhilem

Is this a bug or not? It is good to know if it is necessary to correct it.

yhilem avatar Apr 19 '17 12:04 yhilem

Hi @yhilem,

As you have pointed out current singleton implementation is not thread safe. So it need be fixed to ensure thread safety.

As per the current implementation requestCode attribute is used to track down the request. In API result call backs there are conditions to track the request.

We will keep open this issue until proper fix is introduced.

Thanks & regards, /Charitha

charithag avatar Apr 20 '17 10:04 charithag

Thank you.

yhilem avatar Apr 25 '17 06:04 yhilem