From: Michal Sudolsky sudols...@gmail.com<mailto:sudols...@gmail.com>

> But this fallback would cause UB unless all access to t_nRecursionDepth is 
> atomic or guarded by mutex.

If we want to avoid UB in the multithreaded world, I’m afraid we will have to 
make a C++11 compiler a requirement, as C++03 never acknowledged the existence 
of threads. (That is not limited to this place, a lot of methods like 
PdfEncodingFactory::GlobalPdfRomanEncodingInstance are not currently threadsafe 
in C++03, as discussed earlier.)

Now, if we do that, the solution is easy, make the variables used with the 
recursion guard thread_local. (Atomic or mutex are not a good solution, as 
those would make the recursion guard depend on what other threads are doing at 
the same time.)


Cheers,
Christopher
The MathWorks GmbH | Friedlandstr.18 | 52064 Aachen | District Court Aachen | 
HRB 8082 | Managing Directors: Bertrand Dissler, Steven D. Barbo, Jeanne O’Keefe


_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to