SignalsReceiverControlBlock class is a structure required by threads for "receiving" of signals.
More...
#include "distortos/internal/synchronization/SignalsReceiverControlBlock.hpp"
SignalsReceiverControlBlock class is a structure required by threads for "receiving" of signals.
◆ SignalsReceiverControlBlock()
◆ acceptPendingSignal()
std::pair< int, SignalInformation > distortos::internal::SignalsReceiverControlBlock::acceptPendingSignal |
( |
uint8_t |
signalNumber | ) |
|
Accepts (clears) one of signals that are pending.
This should be called when the signal is "accepted".
- Parameters
-
[in] | signalNumber | is the signal that will be accepted, [0; 31] |
- Returns
- pair with return code (0 on success, error code otherwise) and SignalInformation object for accepted signal; error codes:
◆ afterGenerateQueueLocked()
void distortos::internal::SignalsReceiverControlBlock::afterGenerateQueueLocked |
( |
uint8_t |
signalNumber, |
|
|
ThreadControlBlock & |
threadControlBlock |
|
) |
| const |
|
private |
Actions executed from within critical section after signal is generated with generateSignal() or queued with queueSignal().
Does nothing if the signal is not masked. Otherwise unblocks associated thread if it is currently waiting for the signal that was generated/queued.
- Parameters
-
[in] | signalNumber | is the signal that was generated/queued, [0; 31] |
[in] | threadControlBlock | is a reference to associated ThreadControlBlock |
◆ afterGenerateQueueUnlocked()
void distortos::internal::SignalsReceiverControlBlock::afterGenerateQueueUnlocked |
( |
uint8_t |
signalNumber, |
|
|
ThreadControlBlock & |
threadControlBlock |
|
) |
| const |
|
private |
Actions executed out of critical section after signal is generated with generateSignal() or queued with queueSignal().
- Parameters
-
[in] | signalNumber | is the signal that was generated/queued, [0; 31] |
[in] | threadControlBlock | is a reference to associated ThreadControlBlock |
◆ beforeGenerateQueue()
int distortos::internal::SignalsReceiverControlBlock::beforeGenerateQueue |
( |
uint8_t |
signalNumber, |
|
|
ThreadControlBlock & |
threadControlBlock |
|
) |
| const |
|
private |
Actions executed before signal is generated with generateSignal() or queued with queueSignal().
Requests delivery it the generated/queued signal is not masked.
- Parameters
-
[in] | signalNumber | is the signal that will be generated/queued, [0; 31] |
[in] | threadControlBlock | is a reference to associated ThreadControlBlock |
- Returns
- 0 on success, error code otherwise:
◆ deliveryOfSignalsStartedHook()
int distortos::internal::SignalsReceiverControlBlock::deliveryOfSignalsStartedHook |
( |
| ) |
const |
◆ generateSignal()
int distortos::internal::SignalsReceiverControlBlock::generateSignal |
( |
uint8_t |
signalNumber, |
|
|
ThreadControlBlock & |
threadControlBlock |
|
) |
| |
◆ getPendingSignalSet()
SignalSet distortos::internal::SignalsReceiverControlBlock::getPendingSignalSet |
( |
| ) |
const |
- Returns
- set of currently pending signals
◆ getSignalAction()
std::pair< int, SignalAction > distortos::internal::SignalsReceiverControlBlock::getSignalAction |
( |
uint8_t |
signalNumber | ) |
const |
◆ getSignalMask()
SignalSet distortos::internal::SignalsReceiverControlBlock::getSignalMask |
( |
| ) |
const |
◆ isSignalIgnored()
std::pair< int, bool > distortos::internal::SignalsReceiverControlBlock::isSignalIgnored |
( |
uint8_t |
signalNumber | ) |
const |
|
private |
Checks whether signal is ignored.
Signal is ignored if it has no SignalAction object associated. Signal is never ignored if catching/handling of signals is disabled for this receiver.
- Parameters
-
[in] | signalNumber | is the signal for which the check will be performed, [0; 31] |
- Returns
- pair with return code (0 on success, error code otherwise) and boolean telling whether the signal is ignored (true) or not (false); error codes:
- EINVAL - signalNumber value is invalid;
◆ queueSignal()
int distortos::internal::SignalsReceiverControlBlock::queueSignal |
( |
uint8_t |
signalNumber, |
|
|
sigval |
value, |
|
|
ThreadControlBlock & |
threadControlBlock |
|
) |
| const |
◆ setSignalAction()
std::pair< int, SignalAction > distortos::internal::SignalsReceiverControlBlock::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
- Parameters
-
[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 |
- Returns
- pair with return code (0 on success, error code otherwise) and SignalAction that was associated with signalNumber, default-constructed object if no association was found; error codes:
◆ setSignalMask()
int distortos::internal::SignalsReceiverControlBlock::setSignalMask |
( |
SignalSet |
signalMask, |
|
|
bool |
deliver |
|
) |
| |
Sets signal mask for associated thread.
Similar to pthread_sigmask() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html#
- Parameters
-
[in] | signalMask | is the SignalSet with new signal mask for associated thread |
[in] | deliver | selects whether pending and unblocked signals will be delivered (true) or not (false) |
- Returns
- 0 on success, error code otherwise:
- ENOTSUP - catching/handling of signals is disabled for this receiver;
◆ setWaitingSignalSet()
void distortos::internal::SignalsReceiverControlBlock::setWaitingSignalSet |
( |
const SignalSet *const |
signalSet | ) |
|
|
inline |
- Parameters
-
[in] | signalSet | is a pointer to set of signals that will be "waited for", nullptr when wait was terminated |
◆ pendingSignalSet_
SignalSet distortos::internal::SignalsReceiverControlBlock::pendingSignalSet_ |
|
private |
◆ signalInformationQueue_
◆ signalsCatcherControlBlock_
◆ waitingSignalSet_
const SignalSet* distortos::internal::SignalsReceiverControlBlock::waitingSignalSet_ |
|
private |
pointer to set of "waited for" signals, nullptr if associated thread is not waiting for any signals
The documentation for this class was generated from the following files: