Skip to content
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

Make C++ Session object thread safe #62

Closed
hvge opened this issue Sep 5, 2017 · 0 comments
Closed

Make C++ Session object thread safe #62

hvge opened this issue Sep 5, 2017 · 0 comments
Assignees
Milestone

Comments

@hvge
Copy link
Member

hvge commented Sep 5, 2017

We should make methods in C++ class Sessionthread safe. We had a several discussions about this topic and it looks like that the best solution is to add the synchronization directly to the low level Session object. The original idea was about to synchronize just the signature calculation operations (due to signature counter increment). This seems to be insufficient, because the lifetime of the Session object is typically very long and we're reusing the object for the whole lifetime of PowerAuthSDK object. The long lifetime means higher chance to get an obscure race condition.

Looks like that the sufficient solution is to add a guard-locks to the public Session's methods. So, the change will affect all supported platforms.

Important for IOS

The PA2Session stores the last error code to the object instance. That's also wrong and the interface should be changed. We have a related ticket #49 for that.

@hvge hvge added this to the 0.17.0 milestone Sep 5, 2017
@hvge hvge self-assigned this Sep 5, 2017
@hvge hvge closed this as completed Oct 17, 2017
hvge added a commit that referenced this issue Oct 17, 2017
…hread safety.

IOS: PA2Session now always contains a valid Session instance. The object initializer is validating the instance during the object creation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant