In multithreading (2 thread) program, I have this code:
while(-1) { m.lock(); (...) m.unlock(); }
m is a mutex (
m
It's not a good idea to rely on such code, so you should probably change your design. However, on some operating systems, sleep(0) will yield the thread. (Sleep(0) on Windows) Again, it's best not to rely on this.