Skip to content

Refactor thread safety of KeychainSwift class#152

Open
vdshko wants to merge 1 commit intoevgenyneu:masterfrom
vdshko:refactor/thread-safety-of-KeychainSwift-class
Open

Refactor thread safety of KeychainSwift class#152
vdshko wants to merge 1 commit intoevgenyneu:masterfrom
vdshko:refactor/thread-safety-of-KeychainSwift-class

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