trick/trick_source/sim_services/VariableServer/VariableServer_shutdown.cpp

22 lines
475 B
C++
Raw Normal View History

2015-02-26 15:02:31 +00:00
#include "trick/VariableServer.hh"
2015-02-26 15:02:31 +00:00
int Trick::VariableServer::shutdown() {
// Shutdown all listen threads
2015-02-26 15:02:31 +00:00
listen_thread.cancel_thread() ;
for (auto& listen_it : additional_listen_threads) {
listen_it.second->cancel_thread();
}
// Shutdown all session threads
pthread_mutex_lock(&map_mutex) ;
for (auto& it : var_server_threads) {
it.second->cancel_thread() ;
2015-02-26 15:02:31 +00:00
}
pthread_mutex_unlock(&map_mutex) ;
2015-02-26 15:02:31 +00:00
return 0 ;
}