lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
From: Eric Wong via lttng-dev <lttng-dev@lists.lttng.org>
To: lttng-dev@lists.lttng.org
Subject: [lttng-dev] [PATCH] always check pthread_create for failures
Date: Sun,  2 Oct 2022 16:13:43 +0000	[thread overview]
Message-ID: <20221002161343.854582-1-normalperson@yhbt.net> (raw)

pthread_create may fail with EAGAIN (which is no fault of the
programmer), so don't allow the check to be compiled out.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 src/urcu-defer-impl.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/urcu-defer-impl.h b/src/urcu-defer-impl.h
index 1c96287..cbb0ca8 100644
--- a/src/urcu-defer-impl.h
+++ b/src/urcu-defer-impl.h
@@ -417,7 +417,8 @@ static void start_defer_thread(void)
 	urcu_posix_assert(!ret);
 
 	ret = pthread_create(&tid_defer, NULL, thr_defer, NULL);
-	urcu_posix_assert(!ret);
+	if (ret)
+		urcu_die(ret);
 
 	ret = pthread_sigmask(SIG_SETMASK, &oldmask, NULL);
 	urcu_posix_assert(!ret);
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

             reply	other threads:[~2022-10-02 16:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02 16:13 Eric Wong via lttng-dev [this message]
2022-10-03 14:41 ` [lttng-dev] [PATCH] always check pthread_create for failures Mathieu Desnoyers via lttng-dev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221002161343.854582-1-normalperson@yhbt.net \
    --to=lttng-dev@lists.lttng.org \
    --cc=normalperson@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).