// $Id$ //----------------------------------------------------------------------- // The GSI Online Offline Object Oriented (Go4) Project // Experiment Data Processing at EE department, GSI //----------------------------------------------------------------------- // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH // Planckstr. 1, 64291 Darmstadt, Germany // Contact: http://go4.gsi.de //----------------------------------------------------------------------- // This software can be used under the license agreements as stated // in Go4License.txt file which is part of the distribution. //----------------------------------------------------------------------- #include "TGo4TerminateException.h" #include "TThread.h" #include "TGo4Log.h" #include "TGo4ThreadManager.h" #include "TGo4Runnable.h" TGo4TerminateException::TGo4TerminateException (TGo4Runnable *runnable) { GO4TRACE((14,"TGo4TerminateException::TGo4TerminateException (TGo4Runnable *)", __LINE__, __FILE__)); fxDescription= "!!!-- Go4 Terminate Exception --!!!"; fxThreadManager=runnable->GetThreadManager(); } TGo4TerminateException::TGo4TerminateException (TGo4ThreadManager *man) { GO4TRACE((14,"TGo4TerminateException::TGo4TerminateException(TGo4ThreadManager *)", __LINE__, __FILE__)); fxDescription= "!!!-- Go4 Terminate Exception --!!!"; fxThreadManager=man; } TGo4TerminateException::TGo4TerminateException(const TGo4TerminateException &right) :TGo4ControlException(right) { GO4TRACE((14,"TGo4TerminateException::TGo4TerminateException (const TGo4TerminateException &)", __LINE__, __FILE__)); fxThreadManager=right.fxThreadManager; } TGo4TerminateException & TGo4TerminateException::operator=(const TGo4TerminateException &right) { GO4TRACE((14, "TGo4TerminateException::operator=(const TGo4TerminateException*)", __LINE__, __FILE__)); if (&right != this) { TGo4ControlException::operator=(right); // copy base class members fxThreadManager = right.fxThreadManager; } return *this; } TGo4TerminateException::~TGo4TerminateException() { GO4TRACE((14,"TGo4TerminateException::~TGo4TerminateException()", __LINE__, __FILE__)); } Int_t TGo4TerminateException::Handle () { GO4TRACE((12,"TGo4TaskHandlerAbortException::Handle()", __LINE__, __FILE__)); TGo4Log::Debug("\n Terminate Exception default Handle: Terminating Thread Manager %s ... \n", fxThreadManager->GetName()); fxThreadManager->Terminate(); TThread::CancelPoint(); return 0; }