ヘルスチェックスレッドモジュール。
送信者側で動作する定周期 PING 送信スレッドです。
health_interval_ms 周期で PING パケットを送信します。
受信者側から送信者へのヘルスチェックは行いません (一方向ヘルスチェック)。
c-modernization-kit sample team
1.0.0
2026/03/08
Copyright (C) CompanyName, Ltd. 2026. All rights reserved.
static void health_sleep ( struct PotrContext_ *ctx, int path_idx, uint32_t interval_ms )static uint64_t health_get_ms ( void )static void *health_thread_func ( void *arg )static void *tcp_health_thread_func ( void *arg )int potr_health_thread_start ( struct PotrContext_ *ctx )非 TCP ヘルスチェックスレッドを起動します。
ctx->global.health_interval_ms が 0 の場合は起動しません (POTR_SUCCESS を返します)。
成功時は POTR_SUCCESS、失敗時は POTR_ERROR を返します。
int potr_health_thread_stop ( struct PotrContext_ *ctx )非 TCP ヘルスチェックスレッドを停止します。
成功時は POTR_SUCCESS、失敗時は POTR_ERROR を返します。
int potr_tcp_health_thread_start ( struct PotrContext_ *ctx, int path_idx )TCP ヘルスチェックスレッドを path ごとに起動します。
ctx->global.health_interval_ms が 0 の場合は起動しません (POTR_SUCCESS を返します)。
成功時は POTR_SUCCESS、失敗時は POTR_ERROR を返します。
int potr_tcp_health_thread_stop ( struct PotrContext_ *ctx, int path_idx )TCP ヘルスチェックスレッドを停止します。
成功時は POTR_SUCCESS、失敗時は POTR_ERROR を返します。
static HealthArg[POTR_MAX_PATH] s_health_args;#define POTR_MUTEX_LOCK_LOCAL ( m )
pthread_mutex_lock(m)#define POTR_MUTEX_UNLOCK_LOCAL ( m )
pthread_mutex_unlock(m)struct HealthArg {
struct PotrContext_ *ctx;
int path_idx;
int _pad;
}struct PotrContext_ *ctx;int path_idx;int _pad;