Skip to content

Conversation

@knowledgecode
Copy link
Owner

Summary

  • Add optional abort parameter to unlock() method for immediate lock release
  • Update unit tests to cover new abort functionality
  • Update README.md with documentation and examples

Changes

  • src/blokr.ts: Add abort parameter that resets counter to 0 when true
  • tests/blokr.test.ts: Add 3 new test cases for abort behavior
  • README.md: Document new parameter with clear examples
  • Package files updated

Test plan

  • All existing tests pass (34/34)
  • New abort parameter tests added and passing
  • Normal unlock behavior unchanged when abort is false or omitted
  • Immediate unlock works when abort is true
  • Timeout clearing works correctly with abort

Allows immediate lock release by resetting counter to 0, bypassing normal reference counting behavior.
Covers immediate unlock behavior, timeout clearing, and normal operation with explicit false parameter.
Added documentation for the new optional abort parameter that allows immediate unlock regardless of lock count.
@knowledgecode knowledgecode merged commit 402a4d3 into main Aug 27, 2025
2 checks passed
@knowledgecode knowledgecode deleted the develop branch August 27, 2025 07:17
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.

2 participants