trick/trick_source/sim_services/VariableServer/exit_var_thread.cpp

20 lines
544 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
void exit_var_thread(void *in_vst) {
Trick::VariableServerThread * vst = (Trick::VariableServerThread *) in_vst ;
Trick::VariableServer * vs = vst->get_vs() ;
if (vst->get_pthread_id() != pthread_self()) {
std::cerr << "exit_var_thread must be called from the variable server thread" << std::endl;
}
vs->delete_session(vst->get_pthread_id());
2015-02-26 15:02:31 +00:00
// Tell the variable server that this thread is exiting.
vs->delete_vst(vst->get_pthread_id()) ;
vst->cleanup();
2015-02-26 15:02:31 +00:00
}