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

Cellular_Cleanup does not kill Read Thread #176

Closed
davideferrario opened this issue Jul 26, 2024 · 3 comments
Closed

Cellular_Cleanup does not kill Read Thread #176

davideferrario opened this issue Jul 26, 2024 · 3 comments

Comments

@davideferrario
Copy link

davideferrario commented Jul 26, 2024

_Cellular_Init_ function initializes all the library: create mutexes and all the stuff and with Platform_CreateDetachedThread function create/start the Read thread.

In case of error in Cellular_Init function, this try to cleanup all the allocated resources (Cellular_ModuleCleanUp and _Cellular_LibCleanup are executed). Cellular_ModuleCleanUp and _Cellular_LibCleanup destroy mutexes and all the stuff, except for the thread created by Platform_CreateDetachedThread. This can be a problem in case I would like to re-try to run Cellular_Init in case of error.

Is it possible to add Read thread destroy in cleanup procedure?

@ActoryOu
Copy link
Member

Hello, thank you for bringing this to our attention! We will be looking further into this issue as soon as we can, thank you for your patience!

@chinglee-iot
Copy link
Member

@davideferrario
The thread cleanup can be handled in the Platform_CreateDetachedThread. Please reference our demo implementation.
The created task deletes itself in the wrapper function when it returns from it's thread routine.

@ActoryOu
Copy link
Member

Hi,
I'm going to close this issue for now since @chinglee-iot has been answered your qeustion.
Feel free to reopen if it's not clear.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants