I have the following code:
int main()
{
Client *c = new Client();
ExitOnlyWhenClientException();
return 0;
}
So I don't want main to return only when client throws exception. I know I can use condition variable, which signal in client's destructor and wait in main block.
But Is there another method?
I've found this link How would you implement a basic event-loop?
My question here is a little different compared to above link, since it shoud know client crashed.
EDIT 1
I made a mistake to say crash, which I really mean exception.