Hi all I am developing a simple rotator client that takes a few arguments, connects to the rotator (currently a simulator), and it should just exit the program after reaching its destination. However, if I simply use
exit(0);
after reaching the destination the program complains
BaseClient::~BaseClient: Probability of detecting a deadlock.
I am wondering what is the clean way to exit the program after reaching certain conditions without the need of human intervention? Should I just write a `while(true)` loop and check for conditions in the `main` function? If so, I am worried about blocking the CPU. Should I be worried?
Thanks in advance,
Pedram
Warning: Spoiler!
int main(int argc, char **argv)
{
rotator_client->setServer("localhost", 7624);
rotator_client->watchDevice(arguments.device_name);
rotator_client->connectServer();
cout << "Press any key to terminate the client.\n";
std::cin.ignore(); // <
what should I replace this line with?
// a while loop?
rotator_client->disconnectServer();
}
Last edit: 2 years 6 months ago by Pedram. Reason: Bad formatting