Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Devoogdt <thomas@devoogdt.com>
To: buildroot@buildroot.org
Cc: Thomas Devoogdt <thomas.devoogdt@barco.com>,
	Bart Van Severen <bart.vanseveren@barco.com>
Subject: [Buildroot] [PATCH v1 2/2] package/libwebsockets: fix LWS_MAX_SMP when BR2_TOOLCHAIN_HAS_THREADS is set
Date: Fri, 20 Sep 2024 08:20:14 +0200	[thread overview]
Message-ID: <20240920062014.132862-2-thomas@devoogdt.com> (raw)
In-Reply-To: <20240920062014.132862-1-thomas@devoogdt.com>

From: Bart Van Severen <bart.vanseveren@barco.com>

"If LWS_MAX_SMP=1, then there is no code related to pthreads compiled
 in the library. If unset, LWS_MAX_SMP defaults to 32 and a small
 amount of pthread mutex code is built into the library."

This is a misconception, when unset, LWS_MAX_SMP is actually set to 1,
so mutexes aren't built in.

To fix, set it to 32 explicitly when threads are enabled.

https://libwebsockets.org/lws-api-doc-master/html/md_READMEs_README_8coding.html

Signed-off-by: Bart Van Severen <bart.vanseveren@barco.com>
Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
---
 package/libwebsockets/libwebsockets.mk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/package/libwebsockets/libwebsockets.mk b/package/libwebsockets/libwebsockets.mk
index e53febfce4..90ab5da0c9 100644
--- a/package/libwebsockets/libwebsockets.mk
+++ b/package/libwebsockets/libwebsockets.mk
@@ -18,15 +18,14 @@ LIBWEBSOCKETS_CONF_OPTS = \
 	-DLWS_WITHOUT_EXTENSIONS=OFF
 
 # If LWS_MAX_SMP=1, then there is no code related to pthreads compiled
-# in the library. If unset, LWS_MAX_SMP defaults to 32 and a small
-# amount of pthread mutex code is built into the library.
+# in the library. If unset, LWS_MAX_SMP defaults to 1.
 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
 LIBWEBSOCKETS_CONF_OPTS += \
 	-DLWS_MAX_SMP=1 \
 	-DLWS_WITH_SYS_SMD=OFF
 else
 LIBWEBSOCKETS_CONF_OPTS += \
-	-DLWS_MAX_SMP= \
+	-DLWS_MAX_SMP=32 \
 	-DLWS_WITH_SYS_SMD=ON
 endif
 
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-09-20  6:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-20  6:20 [Buildroot] [PATCH v1 1/2] package/libwebsockets: add an option to enable lws async dns Thomas Devoogdt
2024-09-20  6:20 ` Thomas Devoogdt [this message]
2024-10-26 14:43   ` [Buildroot] [PATCH v1 2/2] package/libwebsockets: fix LWS_MAX_SMP when BR2_TOOLCHAIN_HAS_THREADS is set Thomas Petazzoni via buildroot
2024-10-26 18:25     ` Thomas Devoogdt
2024-10-29 16:06       ` Thomas Petazzoni via buildroot
2025-02-04 12:36         ` Thomas Devoogdt
2026-02-04 14:37   ` Thomas Petazzoni via buildroot
2024-10-26 14:42 ` [Buildroot] [PATCH v1 1/2] package/libwebsockets: add an option to enable lws async dns Thomas Petazzoni via buildroot

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=20240920062014.132862-2-thomas@devoogdt.com \
    --to=thomas@devoogdt.com \
    --cc=bart.vanseveren@barco.com \
    --cc=buildroot@buildroot.org \
    --cc=thomas.devoogdt@barco.com \
    /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