Conversation
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/72a664dd-2122-4767-ab00-e3b28dd0b458 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Tyrrrz
April 14, 2026 15:22
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ports Onova’s LockFile helper into PowerKit, adding a small file-based exclusive lock primitive plus tests to validate acquisition and release behavior.
Changes:
- Added
LockFileutility withTryAcquire(path)semantics. - Added unit tests covering acquisition, contention, and reacquisition after disposal.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| PowerKit/LockFile.cs | Introduces the file-based locking utility and acquisition API. |
| PowerKit.Tests/LockFileTests.cs | Adds tests validating basic lock acquisition/contended acquisition/disposal behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports
LockFilefrom Onova into PowerKit as a general-purpose utility.Changes
PowerKit/LockFile.cs— file-based exclusive lock;TryAcquireopens the file withFileShare.Noneand returnsnullonIOException(the exception .NET raises when the file is already held)PowerKit.Tests/LockFileTests.cs— covers successful acquisition, blocked re-acquisition while held, and re-acquisition after disposalUsage