Making existing ANSI C code threadsafe and re-entrant
问题 I am working on an old legacy ANSI C system, which is littered with a lot of global variables. I am part of a team refactoring the existing codebase, to make the code re-entrant and threadsafe. I found useful material on writing thread safe and re-entrant ANSI C code here. Based on my (admittedly non-perfect) understanding, I have come up with a proposal on how to proceed - but I have already come up with some issues that need addressing, and decided it best to come in here to find out the