Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4RemoveException.h"
00015
00016 #include "TThread.h"
00017
00018 #include "TGo4Log.h"
00019 #include "TGo4Thread.h"
00020 #include "TGo4ThreadManager.h"
00021 #include "TGo4ThreadHandler.h"
00022 #include "TGo4Runnable.h"
00023
00024 TGo4RemoveException::TGo4RemoveException(const TGo4RemoveException &right)
00025 :TGo4ThreadException(right)
00026 {
00027 GO4TRACE((14,"TGo4RemoveException::TGo4RemoveException() copy constructor",__LINE__, __FILE__));
00028 }
00029
00030 TGo4RemoveException::TGo4RemoveException (TGo4Runnable* runnable, const char* threadname)
00031 : TGo4ThreadException(runnable, threadname)
00032 {
00033 GO4TRACE((14,"TGo4RemoveException::TGo4RemoveException(TGo4Runnable*, const char*) constructor",__LINE__, __FILE__));
00034 fxDescription= "!!!-- Go4 Remove Exception --!!!";
00035 }
00036
00037
00038 TGo4RemoveException::~TGo4RemoveException()
00039 {
00040 GO4TRACE((14,"TGo4RemoveException::~TGo4RemoveException() destructor",__LINE__, __FILE__));
00041 }
00042
00043
00044 TGo4RemoveException & TGo4RemoveException::operator=(const TGo4RemoveException &right)
00045 {
00046 GO4TRACE((14,"TGo4RemoveException::operator=",__LINE__, __FILE__));
00047 if (&right!=this)
00048 {
00049 GO4TRACE((13,"TGo4RemoveException::operator= processing copy",__LINE__, __FILE__));
00050 TGo4ThreadException::operator=(right);
00051
00052 return *this;
00053 }
00054 else
00055 {
00056
00057 GO4TRACE((13,"TGo4RemoveException::operator= source and destination objects are identical",__LINE__, __FILE__));
00058 return *this;
00059 }
00060 }
00061
00062 Int_t TGo4RemoveException::Handle ()
00063 {
00064 GO4TRACE((14,"TGo4RemoveException::Handle()",__LINE__, __FILE__));
00065 TString name;
00066 if(GetThreadName()==0)
00067
00068 {
00069 GO4TRACE((13,"TGo4RemoveException::Handle() -- removing thread associated with runnable",__LINE__, __FILE__));
00070 name = fxRunnable->GetThread()->GetName();
00071 }
00072 else
00073
00074 {
00075 GO4TRACE((13,"TGo4CancelException::Handle() -- removing thread by specified name",__LINE__, __FILE__));
00076 name = GetThreadName();
00077 }
00078 fxThreadHandler->RemoveThread(name.Data());
00079 TThread::CancelPoint();
00080 return 0;
00081 }