I have no idea. I need a code example to see how you think it should be written. Mutex?