I got the following case:
1. Thread T1 is running with some work.
2. Thread T2 is checking if some value is true/false. if it's 'true' - T2 should pause T1 execution and resume it after the value is 'false' again.
This is a trivial question, but ... the thread that I want to pause (T1) - was created from another process and I can not alter it's code. Though I can get it's reference or the ID.
Any thoughts on what could be the best way out?
What I have tried:
Was thinking about AutoResetEvent, but not sure how to use it, when I am not supposed to alter the code of thread I want to stop...