| 75 | } |
| 76 | |
| 77 | int SignalInformationQueue::queueSignal(const uint8_t signalNumber, const sigval value) |
| 78 | { |
| 79 | if (signalNumber >= SignalSet::Bitset{}.size()) |
| 80 | return EINVAL; |
| 81 | |
| 82 | if (freeSignalInformationList_.empty() == true) |
| 83 | return EAGAIN; |
| 84 | |
| 85 | auto it = signalInformationList_.before_begin(); |
| 86 | auto next = signalInformationList_.begin(); |
| 87 | const auto last = signalInformationList_.end(); |
| 88 | |
| 89 | while (next != last) // find the iterator to the last element on the list ("before end") |
| 90 | { |
| 91 | it = next; |
| 92 | ++next; |
| 93 | } |
| 94 | |
| 95 | freeSignalInformationList_.front().signalInformation = {signalNumber, SignalInformation::Code::queued, value}; |
| 96 | signalInformationList_.splice_after(it, freeSignalInformationList_.before_begin()); |
| 97 | return 0; |
| 98 | } |
| 99 | |
| 100 | } // namespace internal |
| 101 |
no test coverage detected