Skip to content

Conversation

harrytmthy
Copy link
Owner

Summary

Introduce atomic single-instance semantics and ergonomic accessors. SafeBox.get(...) and SafeBox.getOrNull(...) provide singleton-style retrieval.

Implementation Details

  • Added get(fileName) (throws if not initialized) and getOrNull(fileName).
  • First hit uses a synchronized double-check on the instances map to serialize construction.

Closes #64

@harrytmthy harrytmthy added this to the 1.2.0 milestone Aug 25, 2025
@harrytmthy harrytmthy self-assigned this Aug 25, 2025
@harrytmthy harrytmthy added the enhancement New feature or request label Aug 25, 2025
@harrytmthy harrytmthy merged commit fbb3657 into main Aug 25, 2025
3 checks passed
@harrytmthy harrytmthy deleted the feature/atomicity-and-new-getter branch August 25, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure the thread-safety for SafeBox creation and add new getters
1 participant