sc->start_server runs an endless loop in which a MyClass processing method is invoked in a thread.
How can i replace the while(true) statement in main so that my program waits for all threads to terminate?
EDIT: pthreads-lib is used and main() does not know the pthread_t references
THX
int main(int argc, char** argv)
{
SocketCommunication * sc = SocketCommunication::get_menu(); //Singleton
MyClass yay;
short port = 6644;
sc->start_server(port, &yay);
while(true);
return 0;
}
Use
joinon any thread you want to wait.