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