MCPcopy Create free account
hub / github.com/DISTORTEC/distortos / queueSignal

Method queueSignal

source/synchronization/SignalInformationQueue.cpp:77–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77int 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

Callers 1

queueSignalFunction · 0.45

Calls 7

sizeMethod · 0.45
emptyMethod · 0.45
before_beginMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
frontMethod · 0.45
splice_afterMethod · 0.45

Tested by

no test coverage detected