According to this document about multithreading, it is mandatory to call xmlInitParser()
before using the library concurrently. Here's the problem. I coded a library(not an executable) using libxml2 and it should guarantee concurrency. So I decided to call the init function on my library's init function. However, the document says the function is not reentrant. So it could be problematic if other libraries or the program linking my library calls the function beforehand.
I couldn't find a function or a way to check if the parser(or libxml2 should I say) is initialised. What should I do? Call the function regardless and hope for the best? I'm going to test if the function is reentrant after all, after I post this but that doesn't really tally.
For clarification, in summary:
- Is
xmlInitParser()
actually reentrant? - Any way to check if libxml2 is initialised?
- (OR) How to safely use libxml2 concurrently under the premise that another software could be using it concurrently as well.