JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.0p0 Hot Tips | CONFIDENTIAL | CodeSecure Inc |
A use of pthread_kill(), which terminates the entire process. Some signal arguments to pthread_kill() can terminate the entire process rather than just a single thread, which may not be the intention.
| クラス名 | Use of pthread_kill | ||||||
|---|---|---|---|---|---|---|---|
| 日本語クラス名 | pthread_killの使用 | ||||||
| クラス分類 | 信頼性 (reliability) | ||||||
| ニーモニック | CONCURRENCY.BADFUNC.PTHREAD_KILL | ||||||
| カテゴリー |
|
||||||
| 対応言語 | C および C++ で利用可能です。 |
||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル
(configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Use of pthread_kill" |
#include <pthread.h>
#include <signal.h>
int stop_thread(pthread_t thread, int i){
if (i>0){
return pthread_kill(thread, SIGTERM); /* 'Use of pthread_kill' warning issued here */
}
else {
return pthread_cancel(thread); /* pthread_cancel() terminates a single thread */
}
}
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。