Skip to content

Commit

Permalink
[#116] Add retrieve returned samples also to loan
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Feb 18, 2024
1 parent c245344 commit c68f623
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions iceoryx2/src/port/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ impl<'a, Service: service::Service, MessageType: Debug> UninitLoan<MessageType>
fn loan_uninit(&self) -> Result<SampleMut<MaybeUninit<MessageType>>, PublisherLoanError> {
let msg = "Unable to loan Sample";

self.retrieve_returned_samples();

if self.loan_counter.load(Ordering::Relaxed) >= self.config.max_loaned_samples {
fail!(from self, with PublisherLoanError::ExceedsMaxLoanedChunks,
"{} since already {} samples were loaned and it would exceed the maximum of parallel loans of {}. Release or send a loaned sample to loan another sample.",
Expand Down

0 comments on commit c68f623

Please sign in to comment.