-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Closes #365] Fix TODOs in pipe.rs #362
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e24ee55
Fix Pipe API.
travis1829 3403d1b
Add comments about safety.
travis1829 93f3e81
Add documentation comments.
travis1829 027eea7
Remove TODO.
travis1829 220a53d
Small fix.
travis1829 9918c32
Narrow down unsafe in AllocatedPipe::close().
travis1829 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이와 동시에
Page
를 가리킨다는 것도 명시되어 있어야close
의 안전성이 완전히 설명될 것 같습니다.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드를 더 보다 보니 위 조건을 추가해도 여전히 충분하지 않은 것 같습니다.
AllocatedPipe::close
에서 페이지를 free하면 같은 주소를 가리키던 다른AllocatedPipe
의 invariant가 깨질 수 있습니다. 물론Pipe::close
의 결과가true
일 때만 free하며,Pipe::close
의 결과가true
라는 조건이 같은 주소를 가리키는 다른AllocatedPipe
가 존재하지 않는다는 사실을 보장하므로 구현은 안전한 것이 맞습니다.AllocatedPipe
의 invariant에 "ptr
이 가리키는Pipe
의read_waitchannel
과write_waitchannel
중 하나가false
라면 자기 자신이 아닌 다른AllocatedPipe
가 존재하지 않는다"는(또는 이와 유사한 형태의) 조건이 추가로 있어야 할 것 같습니다.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영했습니다!