Skip to content

Commit

Permalink
fix borrow error when scheduling future inside an executor's callback
Browse files Browse the repository at this point in the history
  • Loading branch information
i509VCB authored and elinorbgr committed Dec 21, 2023
1 parent c6f6b88 commit e4c8c5c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sources/futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ impl<T> EventSource for Executor<T> {
_ => unreachable!(),
};

// Drop the guard since the callback may register another future to the scheduler.
drop(active_guard);

callback(result, &mut ());
}
}
Expand Down

0 comments on commit e4c8c5c

Please sign in to comment.