API for sending signals and handling incoming signals.
More...
API for sending signals and handling incoming signals.
- Warning
- Not intended for new applications.
- Note
- This mechanism is deprecated for delivery of user-generated custom signals. As signal delivery is possible inside RPC call, doing so breaches client-server separation. Users needing synchronization mechanism should migrate to notify_object / wait_for_object API instead. This provides synchronous notification delivery. In the future, signals will only be usable for processing of system-defined signals and, such as signals to manage thread execution (stop, continue) and to signal exceptional behavior.
Threads can send signals asynchronously to each other. Kernel provides mechanism to register signal handler, which gets executed whenever thread receives a signal. There are two kinds of signals:
- catchable - kernel supports sending of 32 distinct catchable signals. Kernel doesn't interpret any of them in any way. If such signal is sent to the thread then thread is simply notified of its arrival.
- non-catchable - these signals are mostly system-defined and thread is not able to catch nor react to them. These include stopping and resuming thread, killing it and signalling memory protection violation error.
If thread doesn't register any signal handler, then signal arrival is effectively a no-op for given thread. In any case, arrival of signal will wake thread up, if it is stopped.
◆ SIGALRM
◆ SIGCONT
◆ SIGKILL
◆ SIGSEGV
◆ SIGSTOP
◆ kill()
| __SYSCALL int CMRX_API() kill |
( |
int |
thread, |
|
|
uint32_t |
signal |
|
) |
| |
◆ send_signal()
| __SYSCALL int CMRX_API() send_signal |
( |
int |
thread, |
|
|
uint32_t |
signal |
|
) |
| |
Send thread a signal.
Send a signal to the thread.
- Parameters
-
| thread | recipient thread id |
| signal | signal number |
- Returns
- 0. Mostly.
◆ signal()
| __SYSCALL int CMRX_API() signal |
( |
int |
signo, |
|
|
void(*)(uint32_t) |
sighandler |
|
) |
| |
◆ signal_handler()
| __SYSCALL int CMRX_API() signal_handler |
( |
int |
signo, |
|
|
void(*)(uint32_t) |
sighandler |
|
) |
| |
Register function as current thread signal handler.
- Parameters
-
| signo | number of signal |
| sighandler | address of function which handles the signal |
- Returns
- 0. Mostly.