I have a deadlock in my code and I want to debug it. 
Due to some reasons, I can't reconstruct it here. The problem reconstructed only at my customers.

My idea is to poll the threads once an hour and check whether they are stuck in the problematic code. I know that there is an option to print the current line of code with `__line__` and `__file__`. Can i do it to another thread? 

For example in my case - I want that my thread will sample the other threads and print their current line of code.

Edit - My platform is RHEL 5.6 and the code is in C++.