* [lttng-dev] [PATCH] always check pthread_create for failures
@ 2022-10-02 16:13 Eric Wong via lttng-dev
2022-10-03 14:41 ` Mathieu Desnoyers via lttng-dev
0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong via lttng-dev @ 2022-10-02 16:13 UTC (permalink / raw)
To: lttng-dev
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [lttng-dev] [PATCH] always check pthread_create for failures
2022-10-02 16:13 [lttng-dev] [PATCH] always check pthread_create for failures Eric Wong via lttng-dev
@ 2022-10-03 14:41 ` Mathieu Desnoyers via lttng-dev
0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers via lttng-dev @ 2022-10-03 14:41 UTC (permalink / raw)
To: Eric Wong, lttng-dev
On 2022-10-02 12:13, Eric Wong via lttng-dev wrote:
> pthread_create may fail with EAGAIN (which is no fault of the
> programmer), so don't allow the check to be compiled out.
Merged into master, stable-0.13, stable-0.12, thanks!
Mathieu
>
> 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
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-03 14:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-02 16:13 [lttng-dev] [PATCH] always check pthread_create for failures Eric Wong via lttng-dev
2022-10-03 14:41 ` Mathieu Desnoyers via lttng-dev
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).