-
Notifications
You must be signed in to change notification settings - Fork 210
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
Improve docs and tests for zircon_object::signal
#120
Conversation
…n `signal::port_packet` Since `port_packet` just defines some C-style data types and the names can convey meanings, I think it is fine to omit docs
…move unused default derive for `PortInterruptPacket`.
…waiter.thread.proc().get_futex()`
Pull Request Test Coverage Report for Build 202035729Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
One more question: I found async-booc says here that:
Is that needed in zCore? |
Another question: there is a |
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.
Looks good!
Sorry for my late response. I was busy on the zCore summer of code last week. QAQ |
About the QuestionsTimer
Seems it's not critical. We can consider removing this code. Port
I prefer to make them private if possible.
High level syscalls, I think.
Yes. So you found a bug :) Futex
For syscall layer, use
In general, objects should be designed to be robust enough. But in the case of futex, it doesn't know the concept of memory space or process. So when using futex within multiple processes, it's the user(syscall layer)'s response to make it correct.
I'm not familiar with the implementation details of futex with threads. Maybe @PanQL and @benpigchu can give a help. Waker
Yes I noticed that. This rule should be followed in all leaf future implementations. Although this issue has not brought trouble so far, it should be fixed later. EventPair
Yes. When you get an object which is known to be a |
Thank you for answering me ☺ |
Is that because we can early exit the syscall if the option is invalid? If so, we can use |
Oh, we can directly use typed bitflags like |
Improve docs and tests for `zircon_object::signal`
Content of this PR
zircon_object::signal
passed#![deny(missing_docs)]
, but#![allow(missing_docs)]
is added insignal::port_packet
.Since
port_packet
just defines some C-style data types and the names can convey meanings, I think it is fine to omit docs.zircon_object::signal
test coverage increases to 96.4%.options
inPort::new()
FutexFuture::drop
: usingwaiter.inner.futex
instead ofwaiter.thread.proc().get_futex()
port.wait
says it takes out all packets, but only takes out one in fact.futex.wake
is wrong.PTAL and see whether the changes are proper. Besides, I still have
Some questions
timer
Slack
is useless. What's the plan about it?port
port_packet
are public?options
be done? Low levelPort::new()
or high level syscalls? Or both? ShouldInterrupt::bind()
validateport.can_bind_to_interrupt()
again? (It is not validated now, so we can pass a port withoutBIND_TO_INTERUPT
option actually)I'm a little bit confused about such kind of questions.
futex
I'm not very familiar with futex, so I might have understood some concepts wrong
proc.get_futex()
and not byFutex::new
? Otherwise the futex cannot be bound to some thread. This question arises from this situation:This is kind of like the question mentioned above about validating port
options
, where the low level primitives are misused . So who is responsible to ensure the correctness? Should the object methods be robust enough themselves, or just let the user obey some contracts?2. What's the use of
waiter.thread
(and the parameterthread
inFutex::wait_with_owner()
)? It is reasonable that the waiter knows which thread is waiting...But it can be set toNone
? And I think it is not used anywhere actually.