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

Fixes thread safety issues in android code. closes #161 #165

Merged
merged 1 commit into from
Oct 8, 2020

Conversation

koskimas
Copy link
Contributor

@koskimas koskimas commented Oct 8, 2020

Before, every call from flutter was executed in a separate thread and only the ensureInitStorageCipher was synchronized. All other operations were run without any synchronization. Most of the code is not thread safe, which caused multiple problems when two or more method calls happened to run at the same time.

This PR fixes the thread safety issues by using a single worker thread in which all calls from flutter are executed.

This closes #161 but probably also fixes #163.

Before, every call from flutter was executed in a separate thread
and only the ensureInitStorageCipher was synchronized. All other
operations were run without any synchronization. Most of the code
is not thread safe, which caused multiple problems when two or
more method calls happened to run at the same time.

This commit fixes the thread safety issues by using a single
worker thread in which all calls from flutter are executed.
@mogol
Copy link
Owner

mogol commented Oct 8, 2020

@koskimas thanks
Let's give it a shot. Your repro case works (or doesn't work) perfectly.

@mogol mogol merged commit ebac200 into mogol:develop Oct 8, 2020
@koskimas
Copy link
Contributor Author

koskimas commented Oct 8, 2020

@mogol Thank you for reviewing and merging this so quickly! And thanks again for your work on this library.

@mogol
Copy link
Owner

mogol commented Oct 8, 2020

I really hope it resolves this long running issues, as it was completely mystery for me for a while 🙏 really appreciate your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants