Skip to content

Add selectable Mutex backend#26

Closed
AllDmeat wants to merge 4 commits intomainfrom
feature/mutex-backend
Closed

Add selectable Mutex backend#26
AllDmeat wants to merge 4 commits intomainfrom
feature/mutex-backend

Conversation

@AllDmeat
Copy link
Copy Markdown
Contributor

Summary

  • add DBThreadSafeLock for explicit backend selection in DBThreadSafeContainer and @ThreadSafe
  • default to Synchronization.Mutex on supported OS versions and fall back to pthread_rwlock_t elsewhere without breaking existing initializer call sites
  • preserve nested read compatibility for the default Mutex-backed path and document backend semantics and availability

Testing

  • swift test
  • swift build -Xswiftc -target -Xswiftc arm64-apple-macosx10.15
  • git diff --check

AllDmeat and others added 4 commits April 30, 2026 16:55
Add DBThreadSafeLock for explicit backend selection and keep the public API source-compatible while defaulting to Synchronization.Mutex on supported OS versions with fallback to pthread_rwlock_t elsewhere.

Also preserve nested read compatibility for the default Mutex-backed path and document the backend semantics and availability.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Increase the nested read regression test timeout from 1 to 3 seconds to reduce watchOS simulator flakiness in CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rewrite the nested read regression test to assert the same-thread nested read behavior directly instead of relying on DispatchQueue scheduling and semaphore timeouts, which proved flaky on simulator CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AllDmeat AllDmeat closed this Apr 30, 2026
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.

1 participant