distortos
v0.7.0
object-oriented C++ RTOS for microcontrollers
|
Signals-related synchronization API of distortos. More...
Classes | |
class | distortos::SignalAction |
SignalAction class contains information needed to handle signal that was caught. More... | |
class | distortos::SignalInformation |
SignalInformation class contains information about queued signal. More... | |
class | distortos::SignalSet |
SignalSet class is used as a set of signals. More... | |
Functions | |
int | distortos::DynamicThread::generateSignal (uint8_t signalNumber) override |
Generates signal for thread. More... | |
SignalSet | distortos::DynamicThread::getPendingSignalSet () const override |
Gets set of currently pending signals. More... | |
int | distortos::DynamicThread::queueSignal (uint8_t signalNumber, sigval value) override |
Queues signal for thread. More... | |
int | distortos::internal::ThreadCommon::generateSignal (uint8_t signalNumber) override |
Generates signal for thread. More... | |
SignalSet | distortos::internal::ThreadCommon::getPendingSignalSet () const override |
Gets set of currently pending signals. More... | |
int | distortos::internal::ThreadCommon::queueSignal (uint8_t signalNumber, sigval value) override |
Queues signal for thread. More... | |
int | distortos::ThisThread::Signals::generateSignal (uint8_t signalNumber) |
Generates signal for current thread. More... | |
SignalSet | distortos::ThisThread::Signals::getPendingSignalSet () |
Gets set of currently pending signals for current thread. More... | |
std::pair< int, SignalAction > | distortos::ThisThread::Signals::getSignalAction (uint8_t signalNumber) |
Gets SignalAction associated with given signal number. More... | |
SignalSet | distortos::ThisThread::Signals::getSignalMask () |
Gets signal mask for current thread. More... | |
int | distortos::ThisThread::Signals::queueSignal (uint8_t signalNumber, sigval value) |
Queues signal for current thread. More... | |
std::pair< int, SignalAction > | distortos::ThisThread::Signals::setSignalAction (uint8_t signalNumber, const SignalAction &signalAction) |
Sets association for given signal number. More... | |
int | distortos::ThisThread::Signals::setSignalMask (SignalSet signalMask) |
Sets signal mask for current thread. More... | |
std::pair< int, SignalInformation > | distortos::ThisThread::Signals::tryWait (const SignalSet &signalSet) |
Tries to accept pending signals. More... | |
std::pair< int, SignalInformation > | distortos::ThisThread::Signals::tryWaitFor (const SignalSet &signalSet, TickClock::duration duration) |
Tries to wait for signals for given duration of time. More... | |
template<typename Rep , typename Period > | |
std::pair< int, SignalInformation > | distortos::ThisThread::Signals::tryWaitFor (const SignalSet &signalSet, const std::chrono::duration< Rep, Period > duration) |
Tries to wait for signals for given duration of time. More... | |
std::pair< int, SignalInformation > | distortos::ThisThread::Signals::tryWaitUntil (const SignalSet &signalSet, TickClock::time_point timePoint) |
Tries to wait for signals until given time point. More... | |
template<typename Duration > | |
std::pair< int, SignalInformation > | distortos::ThisThread::Signals::tryWaitUntil (const SignalSet &signalSet, const std::chrono::time_point< TickClock, Duration > timePoint) |
Tries to wait for signals until given time point. More... | |
std::pair< int, SignalInformation > | distortos::ThisThread::Signals::wait (const SignalSet &signalSet) |
Waits for signals. More... | |
virtual int | distortos::Thread::generateSignal (uint8_t signalNumber)=0 |
Generates signal for thread. More... | |
virtual SignalSet | distortos::Thread::getPendingSignalSet () const =0 |
Gets set of currently pending signals. More... | |
virtual int | distortos::Thread::queueSignal (uint8_t signalNumber, sigval value)=0 |
Queues signal for thread. More... | |
Signals-related synchronization API of distortos.
|
overridevirtual |
Generates signal for thread.
Similar to pthread_kill() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_kill.html
Adds the signalNumber to set of pending signals. If this thread is currently waiting for this signal, it will be unblocked.
[in] | signalNumber | is the signal that will be generated, [0; 31] |
Implements distortos::Thread.
|
pure virtual |
Generates signal for thread.
Similar to pthread_kill() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_kill.html
Adds the signalNumber to set of pending signals. If this thread is currently waiting for this signal, it will be unblocked.
[in] | signalNumber | is the signal that will be generated, [0; 31] |
Implemented in distortos::DynamicThread, and distortos::internal::ThreadCommon.
|
overridevirtual |
Generates signal for thread.
Similar to pthread_kill() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_kill.html
Adds the signalNumber to set of pending signals. If this thread is currently waiting for this signal, it will be unblocked.
[in] | signalNumber | is the signal that will be generated, [0; 31] |
Implements distortos::Thread.
int distortos::ThisThread::Signals::generateSignal | ( | uint8_t | signalNumber | ) |
Generates signal for current thread.
Similar to raise() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/raise.html
Adds the signalNumber to set of pending signals of current thread.
[in] | signalNumber | is the signal that will be generated, [0; 31] |
|
overridevirtual |
Gets set of currently pending signals.
Similar to sigpending() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigpending.html
This function shall return the set of signals that are blocked from delivery and are pending on the thread.
Implements distortos::Thread.
|
pure virtual |
Gets set of currently pending signals.
Similar to sigpending() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigpending.html
This function shall return the set of signals that are blocked from delivery and are pending on the thread.
Implemented in distortos::DynamicThread, and distortos::internal::ThreadCommon.
SignalSet distortos::ThisThread::Signals::getPendingSignalSet | ( | ) |
Gets set of currently pending signals for current thread.
Similar to sigpending() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigpending.html
This function shall return the set of signals that are blocked from delivery and are pending on the current thread.
|
overridevirtual |
Gets set of currently pending signals.
Similar to sigpending() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigpending.html
This function shall return the set of signals that are blocked from delivery and are pending on the thread.
Implements distortos::Thread.
std::pair< int, SignalAction > distortos::ThisThread::Signals::getSignalAction | ( | uint8_t | signalNumber | ) |
Gets SignalAction associated with given signal number.
Similar to sigaction() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaction.html
[in] | signalNumber | is the signal for which the association is requested, [0; 31] |
SignalSet distortos::ThisThread::Signals::getSignalMask | ( | ) |
Gets signal mask for current thread.
Similar to pthread_sigmask() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html#
|
overridevirtual |
Queues signal for thread.
Similar to sigqueue() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigqueue.html
Adds the signalNumber and signal value (sigval union) to queue of SignalInformation objects. If this thread is currently waiting for this signal, it will be unblocked.
[in] | signalNumber | is the signal that will be queued, [0; 31] |
[in] | value | is the signal value |
Implements distortos::Thread.
int distortos::ThisThread::Signals::queueSignal | ( | uint8_t | signalNumber, |
sigval | value | ||
) |
Queues signal for current thread.
Similar to sigqueue() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigqueue.html
Adds the signalNumber and signal value (sigval union) to queue of SignalInformation objects.
[in] | signalNumber | is the signal that will be queued, [0; 31] |
[in] | value | is the signal value |
|
pure virtual |
Queues signal for thread.
Similar to sigqueue() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigqueue.html
Adds the signalNumber and signal value (sigval union) to queue of SignalInformation objects. If this thread is currently waiting for this signal, it will be unblocked.
[in] | signalNumber | is the signal that will be queued, [0; 31] |
[in] | value | is the signal value |
Implemented in distortos::DynamicThread, and distortos::internal::ThreadCommon.
|
overridevirtual |
Queues signal for thread.
Similar to sigqueue() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigqueue.html
Adds the signalNumber and signal value (sigval union) to queue of SignalInformation objects. If this thread is currently waiting for this signal, it will be unblocked.
[in] | signalNumber | is the signal that will be queued, [0; 31] |
[in] | value | is the signal value |
Implements distortos::Thread.
std::pair< int, SignalAction > distortos::ThisThread::Signals::setSignalAction | ( | uint8_t | signalNumber, |
const SignalAction & | signalAction | ||
) |
Sets association for given signal number.
Similar to sigaction() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaction.html
[in] | signalNumber | is the signal for which the association will be set, [0; 31] |
[in] | signalAction | is a reference to SignalAction that will be associated with given signal number, object in internal storage is copy-constructed |
int distortos::ThisThread::Signals::setSignalMask | ( | SignalSet | signalMask | ) |
Sets signal mask for current thread.
Similar to pthread_sigmask() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html#
[in] | signalMask | is the SignalSet with new signal mask for current thread |
std::pair< int, SignalInformation > distortos::ThisThread::Signals::tryWait | ( | const SignalSet & | signalSet | ) |
Tries to accept pending signals.
Similar to sigtimedwait() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigtimedwait.html
This function shall select the lowest pending signal from provided set, atomically clear it from current thread's set of pending signals and return that signal number. If no signal in provided set is pending at the time of the call, then this function shall return immediately with an error.
[in] | signalSet | is a reference to set of signals that may be accepted |
std::pair<int, SignalInformation> distortos::ThisThread::Signals::tryWaitFor | ( | const SignalSet & | signalSet, |
const std::chrono::duration< Rep, Period > | duration | ||
) |
Tries to wait for signals for given duration of time.
Template variant of tryWaitFor(const SignalSet&, TickClock::duration).
Rep | is type of tick counter |
Period | is std::ratio type representing the tick period of the clock, seconds |
[in] | signalSet | is a reference to set of signals that will be waited for |
[in] | duration | is the duration after which the wait for signals will be terminated |
std::pair< int, SignalInformation > distortos::ThisThread::Signals::tryWaitFor | ( | const SignalSet & | signalSet, |
TickClock::duration | duration | ||
) |
Tries to wait for signals for given duration of time.
Similar to sigtimedwait() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigtimedwait.html
This function shall select the lowest pending signal from provided set, atomically clear it from current thread's set of pending signals and return that signal number. If no signal in provided set is pending at the time of the call, the thread shall be suspended until one or more becomes pending or until given duration of time expires.
[in] | signalSet | is a reference to set of signals that will be waited for |
[in] | duration | is the duration after which the wait for signals will be terminated |
std::pair< int, SignalInformation > distortos::ThisThread::Signals::tryWaitUntil | ( | const SignalSet & | signalSet, |
TickClock::time_point | timePoint | ||
) |
Tries to wait for signals until given time point.
Similar to sigtimedwait() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigtimedwait.html
This function shall select the lowest pending signal from provided set, atomically clear it from current thread's set of pending signals and return that signal number. If no signal in provided set is pending at the time of the call, the thread shall be suspended until one or more becomes pending or until given time point is reached
[in] | signalSet | is a reference to set of signals that will be waited for |
[in] | timePoint | is the time point at which the wait for signals will be terminated |
std::pair<int, SignalInformation> distortos::ThisThread::Signals::tryWaitUntil | ( | const SignalSet & | signalSet, |
const std::chrono::time_point< TickClock, Duration > | timePoint | ||
) |
Tries to wait for signals until given time point.
Template variant of tryWaitUntil(const SignalSet&, TickClock::time_point).
Duration | is a std::chrono::duration type used to measure duration |
[in] | signalSet | is a reference to set of signals that will be waited for |
[in] | timePoint | is the time point at which the wait for signals will be terminated |
std::pair< int, SignalInformation > distortos::ThisThread::Signals::wait | ( | const SignalSet & | signalSet | ) |
Waits for signals.
Similar to sigwait() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigwait.html
This function shall select the lowest pending signal from provided set, atomically clear it from current thread's set of pending signals and return that signal number. If no signal in provided set is pending at the time of the call, the thread shall be suspended until one or more becomes pending.
[in] | signalSet | is a reference to set of signals that will be waited for |