File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -270,8 +270,10 @@ impl<T: JobImpl> Entity<T> {
270270 /// Create a new job on this entity.
271271 ///
272272 /// The entity must outlive the pending job until it transitions into the submitted state,
273- /// after which the scheduler owns it.
274- pub fn new_job ( & self , credits : u32 , inner : T ) -> Result < PendingJob < ' _ , T > > {
273+ /// after which the scheduler owns it. Since jobs must be submitted in creation order,
274+ /// this requires a mutable reference to the entity, ensuring that only one new job can be
275+ /// in flight at once.
276+ pub fn new_job ( & mut self , credits : u32 , inner : T ) -> Result < PendingJob < ' _ , T > > {
275277 let mut job: Box < MaybeUninit < Job < T > > > = Box :: try_new_zeroed ( ) ?;
276278
277279 // SAFETY: We hold a reference to the entity (which is a valid pointer),
You can’t perform that action at this time.
0 commit comments