title: Synchronization of three streams in a specific queue with Mutex
body: <p>there is a slight problem with threads, please tell me how to solve it or at least in which direction to look for, looking for a long time, but so far without success ... Here's the problem: there are 3 threads, they can run in any order (321;213;123...). In whatever order flows we would not run, they need to work out in the order 1,2,3. For this purpose, use thread synchronization with ONE mutex. In advance thank you.</p>