On 16/06/2016 15:17, Stefan Hajnoczi wrote: >> Right, we should document job->busy as a quiescent state where no one >> will re-enter the coroutine. > > That statement doesn't correspond with how it's used: > > block_job_sleep_ns() leaves a timer pending and the job will re-enter > when the timer expires. So "no one will re-enter the coroutine" is > too strict.
And of course you're right. :) What I (sloppily) meant was "where the block job code will not re-enter the coroutine", which is what makes it safe to call block_job_enter(). > The important thing is it's safe to call block_job_enter(). In the > block_job_sleep_ns() case the timer is cancelled to prevent doubly > re-entry. > > The doc comment I have in v4 allows the block_job_sleep_ns() case: > > /* > * Set to false by the job while the coroutine has yielded and may be > * re-entered by block_job_enter(). There may still be I/O or event loop > * activity pending. > */ > bool busy; Sounds good! Paolo