-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
thread safety of cJSON #221
Comments
Thread safety is on my list for version 2. And although cJSON is not 100% thread safe at the moment, there is a section in the readme about how it can be used across threads safely. https://github.com/DaveGamble/cJSON#thread-safety If you use The other problems with thread safety is |
It might even be possible to fix the thread safety problem with the allocators with And there is a reason why |
That doesn't fix the problems with |
It would be relatively easy to make cJSON thread safe. Just get rid of the global error variable passing a pointer to a context structure to the parser for the error info. I submitted a request that was ignored some years ago (around 2011). I therefore assume that it is not seen as an important issue. I patched my fork of cJSON to archieve threadsafety. But seeing, that it is so easy to add it, I would like to suggest it again.
The text was updated successfully, but these errors were encountered: