commit 265b7b383007970345575c803d297473cbb1a3a9
parent c0877458748d660cb96c4006bf2808f5952ca019
Author: Florian Dold <florian@dold.me>
Date: Mon, 16 Jan 2023 18:57:17 +0100
initialize pthread attributes
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/taler_wallet_core_lib.c b/taler_wallet_core_lib.c
@@ -181,12 +181,20 @@ TALER_WALLET_run (struct TALER_WALLET_Instance *wh)
pthread_mutex_lock(&wh->handle_mutex);
+ if (0 != pthread_attr_init(&tattr)) {
+ pthread_mutex_unlock(&wh->handle_mutex);
+ fprintf(stderr, "could not initialize pthread attr\n");
+ return -1;
+ }
+
if (0 != pthread_attr_setstacksize(&tattr, WALLET_THREAD_STACK_SIZE)) {
+ pthread_mutex_unlock(&wh->handle_mutex);
fprintf(stderr, "could not set stack size\n");
return -1;
}
if (0 != pthread_create(&wallet_thread, &tattr, run, wh)) {
+ pthread_mutex_unlock(&wh->handle_mutex);
fprintf(stderr, "could not create wallet thread\n");
return -1;
}