Kill all parents child threads from a child thread in C++

2 replies · 2K views · last reply
Superposed_Cat
Messages
388
Reaction score
5
I have a C++ program that starts two threads from the parent thread, I need to kill both children from a child thread.

____> b
|
a -
|_____> c

I need to kill b & c from b. Issue is, I can't use simple flags, as c waits for input using cin.
Any help appreciated.
 
Can't you pass a message back to a and have a kill both threads when it receives the message?
 
  • Like
Likes   Reactions: DEvens