The problem, if any, is somewhere else. Yes, I'm 100% sure.
I little clarification:
Thread.Sleep(0)
is not equivalent to "no operation" or the code where this line is missing. To best of my knowledge, it takes some time for the method call, it cause switching the calling thread off and preemption by some other thread (perhaps one-time), and the actual delay is some random delay more then zero. It could not possibly disrupt operation of your thread.
However, it can indirectly manifest some problem with some probability, if you whole code design is wrong due to
race condition you might embed in your design. I prefer more descriptive term "incorrect dependency on the time of execution". Please see:
http://en.wikipedia.org/wiki/Race_condition[
^].
To start the investigation, you should learn about threading and parallel design from this point of view. You did not provide us enough information to help you.
—SA