@ChaosLord
printf() works inside Forbid() just fine (tho it is bad style IMO). Forbid() is broken when needed.
Permit() is not needed at the end of a subprocess. In fact, it's often useful to avoid the parent being allowed to run before the subprocess has terminated.
The real problem is that stdio is not thread safe.