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() {
|
2023-03-20 22:53:01 +00:00
|
|
|
|
|
|
|
// Shutdown all listen threads
|
2015-02-26 15:02:31 +00:00
|
|
|
listen_thread.cancel_thread() ;
|
2023-03-20 22:53:01 +00:00
|
|
|
for (auto& listen_it : additional_listen_threads) {
|
2023-02-22 17:35:30 +00:00
|
|
|
listen_it.second->cancel_thread();
|
|
|
|
}
|
2022-08-23 18:47:56 +00:00
|
|
|
|
2023-03-20 22:53:01 +00:00
|
|
|
// Shutdown all session threads
|
2021-04-27 04:28:26 +00:00
|
|
|
pthread_mutex_lock(&map_mutex) ;
|
2023-03-20 22:53:01 +00:00
|
|
|
for (auto& it : var_server_threads) {
|
2023-02-22 17:35:30 +00:00
|
|
|
it.second->cancel_thread() ;
|
2015-02-26 15:02:31 +00:00
|
|
|
}
|
2021-04-27 04:28:26 +00:00
|
|
|
pthread_mutex_unlock(&map_mutex) ;
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
return 0 ;
|
|
|
|
}
|
|
|
|
|