| 1 |
.. title:: clang-tidy - bugprone-bad-signal-to-kill-thread |
| 2 |
|
| 3 |
bugprone-bad-signal-to-kill-thread |
| 4 |
================================== |
| 5 |
|
| 6 |
Finds ``pthread_kill`` function calls when a thread is terminated by |
| 7 |
raising ``SIGTERM`` signal and the signal kills the entire process, not |
| 8 |
just the individual thread. Use any signal except ``SIGTERM``. |
| 9 |
|
| 10 |
.. code-block:: c++ |
| 11 |
|
| 12 |
pthread_kill(thread, SIGTERM); |
| 13 |
|
| 14 |
This check corresponds to the CERT C Coding Standard rule |
| 15 |
`POS44-C. Do not use signals to terminate threads |
| 16 |
<https://wiki.sei.cmu.edu/confluence/display/c/POS44-C.+Do+not+use+signals+to+terminate+threads>`_. |
| 17 |
|
| 18 |
`cert-pos44-c` redirects here as an alias of this check. |