2015-02-26 15:02:31 +00:00
|
|
|
|
2015-06-01 15:28:29 +00:00
|
|
|
#include "trick/VariableServer.hh"
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
int Trick::VariableServer::shutdown() {
|
|
|
|
listen_thread.cancel_thread() ;
|
|
|
|
std::map < pthread_t , VariableServerThread * >::iterator it ;
|
2021-04-27 04:28:26 +00:00
|
|
|
pthread_mutex_lock(&map_mutex) ;
|
2015-02-26 15:02:31 +00:00
|
|
|
for ( it = var_server_threads.begin() ; it != var_server_threads.end() ; it++ ) {
|
|
|
|
(*it).second->cancel_thread() ;
|
|
|
|
// cancelling causes each var_server_thread map element to be erased by the exit_var_thread function
|
|
|
|
}
|
2021-04-27 04:28:26 +00:00
|
|
|
pthread_mutex_unlock(&map_mutex) ;
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
return 0 ;
|
|
|
|
}
|
|
|
|
|