I have a piece of code which I want to make thread safe. The thing is, the process begins at one thread, then creates another thread and continues from there. Therefore, using a