<div dir="ltr">Hello,<br><br>I have a problem with interruption of threads.<br>I have one function that I want to run in two different threads with different parameters. When one of the function&#39;s instances finishes it stops the other instance. I can&#39;t change the function&#39;s code, but I can write wrapper to it. <br>

My problem is in stopping the other thread. Using timed_join I find which thread is finished, but I can&#39;t find a good solution for stopping the second one.<br>How should I use interrupt method correctly or suggest me for correct thread stopping function. <br>

BTW, I can&#39;t just leave the other thread to run, it&#39;s very high CPU consumer. <br><br>Thank you all.<br></div>

