From 5f42ef3c92b3a1f5679e92ba3b2bb3a547c16da2 Mon Sep 17 00:00:00 2001 From: Sebastian Kloska Date: Tue, 10 Sep 2019 14:25:34 +0200 Subject: Proper setup and error checking of pthread_create * Replace all start_XXX functions with one start_thread * Don't make pthread_t static * Don't use pthread_attr_t. Simply pass NULL * Bail out when pthread_create() fails * Check if MAX_THREADS gets exceeded Signed-off-by: Sebastian Kloska --- src/system/dlt-system-watchdog.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/system/dlt-system-watchdog.c') diff --git a/src/system/dlt-system-watchdog.c b/src/system/dlt-system-watchdog.c index f85398b..fd6bcac 100644 --- a/src/system/dlt-system-watchdog.c +++ b/src/system/dlt-system-watchdog.c @@ -160,17 +160,4 @@ void watchdog_thread(void *v_conf) DLT_LOG(watchdogContext, DLT_LOG_ERROR, DLT_STRING("systemd watchdog timeout (WATCHDOG_USEC) is null\n")); } } - -void start_systemd_watchdog(DltSystemConfiguration *conf) -{ - DLT_LOG(dltsystem, DLT_LOG_DEBUG, DLT_STRING("Creating thread for systemd watchdog\n")); - - static pthread_attr_t t_attr; - static pthread_t pt; - - if (pthread_create(&pt, &t_attr, (void *)watchdog_thread, conf) == 0) - threads.threads[threads.count++] = pt; - else - DLT_LOG(dltsystem, DLT_LOG_ERROR, DLT_STRING("Could not create thread for systemd watchdog\n")); -} #endif -- cgit v1.2.1