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

_mosquitto_destroy is canceling thread #166

Closed
jcavar opened this issue May 18, 2016 · 2 comments
Closed

_mosquitto_destroy is canceling thread #166

jcavar opened this issue May 18, 2016 · 2 comments

Comments

@jcavar
Copy link
Contributor

jcavar commented May 18, 2016

Hi again,
So we use our own threads with mosquitto. We are calling mosquitto_new from Thread 1 and mosquitto_loop_forever from Thread 2. Now, mosquitto_new assigns thread_self() as thread_id which is in our case Thread 1 id. _mosquitto_destroy calls then pthread_cancel on it so Thread 1 is canceled.

We were able to workaround this by moving everything to Thread 2, but I think mosquitto should destroy threads only in case mosquitto_loop_start is called which is signal to mosquitto to use its own threads.
Does this make sense?

ralight added a commit that referenced this issue May 18, 2016
libmosquitto shouldn't cancel threads it didn't create. This change
allows us to keep track of whether threads were created by the library
or by external code.

Thanks to Josip Ćavar.

Bug: #166
@ralight
Copy link
Contributor

ralight commented May 18, 2016

Yes, I agree. This should be fixed now. Thanks for the report.

@ralight ralight closed this as completed May 18, 2016
@jcavar
Copy link
Contributor Author

jcavar commented May 18, 2016

Great, thank you for fixing it this fast!

@ralight ralight added this to the 1.4.9 milestone May 19, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants