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

Refactor thread safety of KeychainSwift class #152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vdshko
Copy link

@vdshko vdshko commented May 11, 2022

Switched NSLock to NSRecursiveLock to avoid the need for an internal deleteNoLock() method and remove it.

NSRecursiveLock is conform to the same NSLocking protocol as NSLock but the fundamental difference is that NSRecursiveLock allows locking resources recursively. The main rule here is .unlock() calls must be as much as .lock() calls.
That is why we no more need the internal deleteNoLock method, which was added, as I suppose, to avoid deadlock.

  • KeychainSwiftDistrib.swift file - updated
  • All tests passed

Screenshot 2022-05-11 at 16 17 00

…ock to avoid the need in internal "deleteNoLock" method and remove it.
@aehlke
Copy link

aehlke commented Jul 2, 2024

still needed / up to date?

aehlke added a commit to lake-of-fire/keychain-swift that referenced this pull request Jul 2, 2024
@vdshko
Copy link
Author

vdshko commented Aug 8, 2024

Yes

@aehlke
Copy link

aehlke commented Aug 8, 2024

I'm using it in production. Works well. Thanks

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

Successfully merging this pull request may close these issues.

3 participants