I am running a multithreaded program.
One thread(not the main thread) captures the screen continuously every 200ms and write the data to a TCP socket.
Another thread will listen for incoming data in the TCP socket.
I assume, the problem is caused when I call [NSThread sleepForTimeInterval:0.2]
, some other thread will start running and it doesn't finish its work before the 200 ms.
How do I know which Thread is currently running? In other words, when the code stays in [NSThread sleepForTimeInterval:]
I want to know the current code(with Class Name/Line number) that is being executed?