Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with multithreading #3193

Closed
OgreTransporter opened this issue Dec 30, 2024 · 1 comment
Closed

Bug with multithreading #3193

OgreTransporter opened this issue Dec 30, 2024 · 1 comment

Comments

@OgreTransporter
Copy link

If you try to compile mosquitto without multithreading (-DWITH_THREADING=OFF) you will get a number of error messages, because mosquitto_internal.h line 271 checks whether threading is enabled or not, but not in the rest of the library.

#if defined(WITH_THREADING) && !defined(WITH_BROKER)

For example, an attempt is made in handle_connack.c line 120 to use the variable state_mutex, but this is not defined if no threads are activated.

pthread_mutex_lock(&mosq->state_mutex);

pthread is now used without verification in so many files that the library must be assumed to be required.

@github-actions github-actions bot added the Status: Available No one has claimed responsibility for resolving this issue. label Dec 30, 2024
@ralight
Copy link
Contributor

ralight commented Jan 21, 2025

Thanks for the report, but closing because it's a duplicate of #3183. This is anyway fixed for 2.0.21.

@ralight ralight closed this as completed Jan 21, 2025
@ralight ralight added Status: Duplicate and removed Status: Available No one has claimed responsibility for resolving this issue. labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants