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