Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4ThreadManager/TGo4ThreadHandler.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4ThreadHandler.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "TGo4ThreadManager.h"
00021 #include "Go4Log/TGo4Log.h"
00022 #include "Go4LockGuard/TGo4LockGuard.h"
00023 
00024 TGo4ThreadHandler::TGo4ThreadHandler(const TGo4ThreadHandler &right)
00025   : TNamed(right)
00026 {
00027    TRACE((15,"TGo4ThreadHandler::TGo4ThreadHandler() copy constructor",__LINE__, __FILE__));
00028    fxManager = right.fxManager;
00029    fxListMutex=new TMutex;
00030    fxOperMutex=new TMutex;
00031    fxArray= (TObjArray*) ((right.fxArray)->Clone());
00032    fxIterator=fxArray->MakeIterator();
00033 }
00034 
00035 TGo4ThreadHandler::TGo4ThreadHandler (const char* name, TGo4ThreadManager* parent)
00036    :TNamed(name,"This is a TGo4ThreadHandler"),fbIsOperating(kFALSE)
00037 {
00038    TRACE((15,"TGo4ThreadHandler::TGo4ThreadHandler(Text_t*, TGo4ThreadManager*) constructor",__LINE__, __FILE__));
00039    fxManager=parent;
00040    fxListMutex=new TMutex;
00041    fxOperMutex=new TMutex;
00042    fxArray=new TObjArray;
00043    fxIterator=fxArray->MakeIterator();
00044 }
00045 
00046 
00047 TGo4ThreadHandler::~TGo4ThreadHandler()
00048 {
00049    TRACE((15,"TGo4ThreadHandler::~TGo4ThreadHandler() destructor",__LINE__, __FILE__));
00050    StopAll();
00051    CancelAll();
00052    TGo4Thread* th=0;
00053    {
00054    TGo4LockGuard listguard(fxListMutex);
00055       fxIterator->Reset();
00056       while((th= (TGo4Thread*) fxIterator->Next())!=0)
00057          {
00058             if(th->IsInternal())
00059                // internal mode? then delete thread object
00060                {
00061                   TRACE((14,"TGo4ThreadHandler::~TGo4ThreadHandler() Removing internal mode thread",__LINE__, __FILE__));
00062                   fxArray->Remove(th);
00063                   fxArray->Compress();
00064                   fxArray->Expand(fxArray->GetLast()+1);
00065                   delete th;
00066                }
00067             else
00068                {
00069                   // do nothing
00070                   TRACE((14,"TGo4ThreadHandler::~TGo4ThreadHandler() Non internal mode thread",__LINE__, __FILE__));
00071                }
00072          }// while(th=...)
00073       delete fxIterator;
00074       fxArray->Clear(); // remove objects from array, but do not delete them
00075       delete fxArray;
00076    }
00077    delete fxOperMutex;
00078    delete fxListMutex;
00079 }
00080 
00081 Bool_t TGo4ThreadHandler::AddThread (TGo4Thread* gthr)
00082 {
00083    TRACE((14,"TGo4ThreadHandler::AddThread(TGo4Thread*)",__LINE__, __FILE__));
00084    Bool_t rev=kFALSE;
00085       {
00086       TGo4LockGuard listguard(fxListMutex);
00087          if(fxArray->FindObject(gthr)==0)
00088          // is thread already in list?
00089             {
00090                //no, add new thread
00091                TRACE((13,"TGo4ThreadHandler::AddThread(TGo4Thread*) Adding new go4 thread to array",__LINE__, __FILE__));
00092                fxArray->AddLast(gthr);
00093                rev=kTRUE;
00094             }
00095          else
00096             {
00097                // yes, do nothing
00098                TRACE((13,"TGo4ThreadHandler::AddThread(TGo4Thread*) Thread was already in array",__LINE__, __FILE__));
00099                rev=kFALSE;
00100             }
00101       }
00102    return rev;
00103 }
00104 
00105 Bool_t TGo4ThreadHandler::RemoveThread (const char* name)
00106 {
00107    TRACE((14,"TGo4ThreadHandler::RemoveThread(Text_t*)",__LINE__, __FILE__));
00108    Bool_t rev=kFALSE;
00109    {
00110       TGo4LockGuard listguard(fxListMutex);
00111       TObject* obj=fxArray->FindObject(name);
00112       TGo4Thread* th= (TGo4Thread*) obj;
00113       if(obj!=0)
00114          // thread found, then remove it
00115          {
00116             TRACE((13,"TGo4ThreadHandler::RemoveThread(Text_t*) Removing thread from array",__LINE__, __FILE__));
00117            fxArray->Remove(obj);
00118             fxArray->Compress();
00119             fxArray->Expand(fxArray->GetLast()+1);
00120             if(th->IsInternal())
00121                // internal mode? then delete thread
00122                {
00123                TRACE((13,"TGo4ThreadHandler::RemoveThread(Text_t*) Deleting internal mode thread",__LINE__, __FILE__));
00124                TGo4LockGuard operguard(fxOperMutex); // protect operating flag
00125                   fbIsOperating=kTRUE;
00126                   fxManager->UnBlockApp(); // tell blocking timer to enable system
00127                   delete th;
00128                   fbIsOperating=kFALSE;
00129                   fxManager->BlockApp();  // blocking again
00130                }
00131             else
00132                {
00133                // do nothing
00134                TRACE((13,"TGo4ThreadHandler::RemoveThread(Text_t*) Non internal mode thread is not deleted",__LINE__, __FILE__));
00135                }
00136             rev=kTRUE;
00137          }
00138       else
00139          {
00140             TRACE((13,"TGo4ThreadHandler::RemoveThread(Text_t*) Thread not found in array",__LINE__, __FILE__));
00141             rev=kFALSE;
00142          }
00143    }
00144    return rev;
00145 }
00146 
00147 Bool_t TGo4ThreadHandler::NewThread(const char* name, TGo4Runnable* runnable)
00148 {
00149    TRACE((14,"TGo4ThreadHandler::NewThread(const char*,TGo4Runnable*)",__LINE__, __FILE__));
00150    TGo4Runnable* nrun=0;
00151    TGo4Thread* nthread=0;
00152    if(runnable==0)
00153       {
00154          TRACE((13,"TGo4ThreadHandler::NewThread(const char*,TGo4Runnable*) No runnable specified error",__LINE__, __FILE__));
00155          return kFALSE;
00156          //throw TGo4RuntimeException();
00157       }
00158   else
00159      {
00160         TRACE((13,"TGo4ThreadHandler::NewThread(const char*,TGo4Runnable*) Assigning external runnable to new internal thread",__LINE__, __FILE__));
00161         nrun=runnable;
00162      }
00163   nthread= new TGo4Thread(name,nrun,kTRUE);
00164   return AddThread(nthread);
00165 }
00166 
00167 Int_t TGo4ThreadHandler::CreateAll ()
00168 {
00169    TRACE((15,"TGo4ThreadHandler::CreateAll()",__LINE__, __FILE__));
00170    Int_t createdthreads=0; // return value: number of creation successes
00171    TGo4Thread* th=0;
00172    {
00173    TGo4LockGuard listguard(fxListMutex);  // protect thread list array
00174    TGo4LockGuard operguard(fxOperMutex); // protect operating flag
00175       fbIsOperating=kTRUE;
00176       fxManager->UnBlockApp(); // tell blocking timer to enable system
00177       fxIterator->Reset();
00178       while((th= (TGo4Thread*) fxIterator->Next())!=0)
00179          {
00180             if(th->Create())
00181                {
00182                   TRACE((13,"TGo4ThreadHandler::CreateAll() Thread creation success",__LINE__, __FILE__));
00183                   ++createdthreads; // increment success counter
00184                }
00185             else
00186                {
00187                   TRACE((13,"TGo4ThreadHandler::CreateAll() Thread not created",__LINE__, __FILE__));
00188                   // thread was already up, no new thread created
00189                }
00190          }
00191       fxManager->BlockApp(); // tell blocking timer to enable system
00192       fbIsOperating=kFALSE;
00193    }
00194    return createdthreads;
00195 }
00196 
00197 Bool_t TGo4ThreadHandler::Create (const char* thname)
00198 {
00199    TRACE((14,"TGo4ThreadHandler::Create(Text_t*)",__LINE__, __FILE__));
00200    Bool_t rev=kFALSE;
00201    TGo4Thread* th=GetThread(thname);
00202    if(th!=0)
00203      // thread was found in list
00204       {
00205       TRACE((13,"TGo4ThreadHandler::Create(Text_t*) Creating new TThread for Go4Thread",__LINE__, __FILE__));
00206       TGo4LockGuard operguard(fxOperMutex); // protect operating flag
00207          fbIsOperating=kTRUE;
00208          fxManager->UnBlockApp(); // tell blocking timer to enable system
00209          rev=th->Create();
00210          fbIsOperating=kFALSE;
00211          fxManager->BlockApp(); // block again afterwards
00212       }
00213    else
00214       // no such thread
00215       {
00216       TRACE((13,"TGo4ThreadHandler::Create(Text_t*) Go4Thread was not found in thread array!",__LINE__, __FILE__));
00217         rev=kFALSE;
00218       }
00219    return rev;
00220 }
00221 
00222 Int_t TGo4ThreadHandler::CancelAll ()
00223 {
00224    TRACE((15,"TGo4ThreadHandler::CancelAll()",__LINE__, __FILE__));
00225    Int_t cancelledthreads=0; // return value: number of successes
00226    TGo4Thread* th=0;
00227       {
00228       TGo4LockGuard listguard(fxListMutex);
00229       TGo4LockGuard operguard(fxOperMutex); // protect operating flag
00230          fbIsOperating=kTRUE;
00231          fxIterator->Reset();
00232          while((th= (TGo4Thread*) fxIterator->Next())!=0)
00233             {
00234                if(th->Cancel())
00235                   {
00236                      TRACE((13,"TGo4ThreadHandler::CancelAll() Thread Cancel success",__LINE__, __FILE__));
00237                      ++cancelledthreads; // increment success counter
00238                   }
00239                else
00240                 {
00241                      // thread was already down, not cancelled
00242                      TRACE((13,"TGo4ThreadHandler::CancelAll() Thread was not canceled",__LINE__, __FILE__));
00243 
00244                 }
00245             }
00246          fbIsOperating=kFALSE;
00247       }
00248    return cancelledthreads;
00249 }
00250 
00251 Bool_t TGo4ThreadHandler::Cancel (const char* thname)
00252 {
00253    TRACE((14,"TGo4ThreadHandler::Cancel(Text_t*)",__LINE__, __FILE__));
00254    Bool_t rev=kFALSE;
00255    TGo4Thread* th=GetThread(thname);
00256    if(th!=0)
00257         // go4thread was found in list
00258       {
00259       TRACE((13,"TGo4ThreadHandler::Cancel(Text_t*) Canceling TThread",__LINE__, __FILE__));
00260       TGo4LockGuard operguard(fxOperMutex); // protect operating flag
00261          fbIsOperating=kTRUE;
00262          fxManager->UnBlockApp(); // tell blocking timer to enable system
00263          rev=th->Cancel();
00264          fbIsOperating=kFALSE;
00265          fxManager->BlockApp();  // blocking again
00266       }
00267    else
00268       // no such go4thread
00269       {
00270          TRACE((13,"TGo4ThreadHandler::Cancel(Text_t*) Go4Thread was not found in thread array!",__LINE__, __FILE__));
00271          rev=kFALSE;
00272       }
00273    return rev;
00274 }
00275 
00276 Int_t TGo4ThreadHandler::ReCreateAll ()
00277 {
00278    TRACE((15,"TGo4ThreadHandler::ReCreateAll()",__LINE__, __FILE__));
00279    Int_t recreatedthreads=0; // return value: number of creation successes
00280    TGo4Thread* th=0;
00281    {
00282    TGo4LockGuard listguard(fxListMutex);
00283    TGo4LockGuard operguard(fxOperMutex); // protect operating flag
00284       fbIsOperating=kTRUE;
00285       fxIterator->Reset();
00286       while((th= (TGo4Thread*) fxIterator->Next())!=0)
00287          {
00288             if(th->ReCreate())
00289                {
00290                   TRACE((13,"TGo4ThreadHandler::ReCreateAll() Thread ReCreate success",__LINE__, __FILE__));
00291                   ++recreatedthreads; // increment success counter
00292                }
00293             else
00294                {
00295                   // thread was already up, no new thread created
00296                   TRACE((13,"TGo4ThreadHandler::ReCreateAll() Thread was not recreated",__LINE__, __FILE__));
00297 
00298                }
00299          }
00300       fbIsOperating=kFALSE;
00301    }
00302    return recreatedthreads;
00303 }
00304 
00305 Bool_t TGo4ThreadHandler::ReCreate (const char* thname)
00306 {
00307    TRACE((14,"TGo4ThreadHandler::ReCreate(Text_t*)",__LINE__, __FILE__));
00308    Bool_t rev=kFALSE;
00309    TGo4Thread* th=GetThread(thname);
00310    if(th!=0)
00311       // thread was found in list
00312       {
00313       TRACE((13,"TGo4ThreadHandler::ReCreate(Text_t*) ReCreating TThread for Go4Thread",__LINE__, __FILE__));
00314       TGo4LockGuard operguard(fxOperMutex); // protect operating flag
00315          fbIsOperating=kTRUE;
00316          fxManager->UnBlockApp(); // tell blocking timer to enable system
00317          rev=th->ReCreate();
00318          fbIsOperating=kFALSE;
00319          fxManager->BlockApp(); // block again afterwards
00320       }
00321    else
00322      // no such thread
00323       {
00324       TRACE((13,"TGo4ThreadHandler::ReCreate(Text_t*) Go4Thread was not found in thread array!",__LINE__, __FILE__));
00325          rev=kFALSE;
00326       }
00327 
00328   return rev;
00329 }
00330 
00331 Int_t TGo4ThreadHandler::StartAll ()
00332 {
00333    TRACE((15,"TGo4ThreadHandler::StartAll()",__LINE__, __FILE__));
00334    Int_t startedfuncs=0; // return value: number of successes
00335    TGo4Thread* th=0;
00336       {
00337       TGo4LockGuard listguard(fxListMutex);
00338       TGo4LockGuard operguard(fxOperMutex); // protect operating flag
00339          fbIsOperating=kTRUE;     // Start has Create option, so we need gSystem
00340          fxManager->UnBlockApp(); // tell blocking timer to enable system
00341          fxIterator->Reset();
00342          while((th= (TGo4Thread*) fxIterator->Next())!=0)
00343             {
00344                if(!th->Start())
00345                   // StartWork returns fbFuncrun status _before_ call
00346                   // false: Workfunc was started from stopped status
00347                   {
00348                      // false: Workfunc was started from stopped status
00349                      TRACE((13,"TGo4ThreadHandler::StartAll() Thread Start success",__LINE__, __FILE__));
00350                      ++startedfuncs; // increment success counter
00351                   }
00352                else
00353                   {
00354                      // true:
00355                      // function was already running before
00356                      TRACE((13,"TGo4ThreadHandler::StartAll() Thread was already running",__LINE__, __FILE__));
00357                   }
00358             }
00359          fbIsOperating=kFALSE;
00360          fxManager->BlockApp();
00361       }
00362    return startedfuncs;
00363 }
00364 
00365 Bool_t TGo4ThreadHandler::Start (const char* thname)
00366 {
00367    TRACE((14,"TGo4ThreadHandler::Start(const char*)",__LINE__, __FILE__));
00368    Bool_t rev=kFALSE;
00369    TGo4Thread* th=GetThread(thname);
00370    if(th!=0)
00371       // thread was found in list
00372       {
00373       TRACE((13,"TGo4ThreadHandler::Start(const char*) Starting Thread",__LINE__, __FILE__));
00374       TGo4LockGuard operguard(fxOperMutex); // protect operating flag
00375          fbIsOperating=kTRUE;     // Start has Create option, so we need gSystem
00376          fxManager->UnBlockApp(); // tell blocking timer to enable system
00377          rev=th->Start();
00378          fbIsOperating=kFALSE;
00379          fxManager->BlockApp(); // tell blocking timer to block system
00380       }
00381    else
00382       // no such thread
00383       {
00384       TRACE((13,"TGo4ThreadHandler::Start(Text_t*) Go4Thread was not found in thread array!",__LINE__, __FILE__));
00385          rev=kFALSE;
00386       }
00387    return rev;
00388 }
00389 
00390 Int_t TGo4ThreadHandler::StopAll ()
00391 {
00392    TRACE((15,"TGo4ThreadHandler::StopAll()",__LINE__, __FILE__));
00393    Int_t stoppedfuncs=0; // return value: number of successes
00394    TGo4Thread* th=0;
00395       {
00396       TGo4LockGuard listguard(fxListMutex);
00397          fxIterator->Reset();
00398          while((th= (TGo4Thread*) fxIterator->Next())!=0)
00399             {
00400                if(th->Stop())
00401                   // StopWork returns fbFuncrun status _before_ call
00402                   {
00403                      // true: Workfunc was stopped from running status
00404                      TRACE((13,"TGo4ThreadHandler::StopAll() Go4Thread Stop success",__LINE__, __FILE__));
00405                      ++stoppedfuncs; // increment success counter
00406                   }
00407                else
00408                   {
00409                      // false:
00410                      // function was already stopped  before
00411                      TRACE((13,"TGo4ThreadHandler::StopAll() Go4Thread was already stopped",__LINE__, __FILE__));
00412                   }
00413             }
00414       }
00415    return stoppedfuncs;
00416 }
00417 
00418 Bool_t TGo4ThreadHandler::Stop (const char* thname)
00419 {
00420    TRACE((14,"TGo4ThreadHandler::Stop(const char*)",__LINE__, __FILE__));
00421    Bool_t rev=kFALSE;
00422    TGo4Thread* th=GetThread(thname);
00423    if(th!=0)
00424       // thread was found in list
00425       {
00426          TRACE((13,"TGo4ThreadHandler::Stop(const char*) Stopping Go4Runnable",__LINE__, __FILE__));
00427          rev=th->Stop();
00428       }
00429    else
00430       // no such thread
00431       {
00432          TRACE((13,"TGo4ThreadHandler::Stop(const char*) Go4Thread was not found in thread array!",__LINE__, __FILE__));
00433          rev=kFALSE;
00434       }
00435    return rev;
00436 }
00437 
00438 Int_t TGo4ThreadHandler::DumpThreads (Int_t mode)
00439 {
00440    TRACE((15,"TGo4ThreadHandler::DumpThreads(Int_t)",__LINE__, __FILE__));
00441    if(TGo4Log::GetIgnoreLevel()>0) return 2; // only write threaddumpfile for debug mode
00442    Int_t retval=0;
00443    TGo4Thread* th=0;
00444    FILE* fp;
00445    Int_t i=0;
00446    char Filename[80];
00447    switch(mode)
00448       {
00449          case 0:
00450             {
00451             TRACE((14,"TGo4ThreadHandler::DumpThreads(Int_t) mode 0: File output",__LINE__, __FILE__));
00452             strcpy(Filename,"threaddump.txt");
00453             fp = fopen(Filename,"w");
00454             if (!fp)
00455                {
00456                TRACE((13,"TGo4ThreadHandler::DumpThreads(Int_t) fopen failed!!",__LINE__, __FILE__));
00457                   TGo4Log::Debug(" ThreadHandler -- Error, Could not open thread dump file!");
00458                   retval=1;
00459                   break;
00460                }
00461             else
00462                {
00463                TRACE((13,"TGo4ThreadHandler::DumpThreads(Int_t) writing into opened file",__LINE__, __FILE__));
00464                 fprintf(fp,"\nTGo4ThreadHandler thread information dump file:\n");
00465                      {
00466                      TGo4LockGuard listguard(fxListMutex);
00467                         fxIterator->Reset();
00468                         while((th= (TGo4Thread*) fxIterator->Next())!=0)
00469                            {
00470                               fprintf(fp,"TGo4Thread %d: \tPID:%d \tSelfID: %d",
00471                                  i++,th->GetPID(),(int) th->GetSelfID());
00472                               fprintf(fp,"\t name: %s\n",th->GetName());
00473                            }
00474                      }
00475                   if (fclose(fp))
00476                      {
00477                      TRACE((13,"TGo4ThreadHandler::DumpThreads(Int_t) fclose failed!!",__LINE__, __FILE__));
00478                         TGo4Log::Debug(" ThreadHandlerr -- Error, Could not close thread dump file!");
00479                         retval=1;
00480                      }
00481                } // if(!fp)/else
00482             }//case 0:
00483             break;
00484       default:
00485          {
00486          TRACE((14,"TGo4ThreadHandler::DumpThreads(Int_t) mode: default ",__LINE__, __FILE__));
00487             TGo4Log::Debug(" ThreadHandlerr -- Error: DumpThreads mode unknown ");
00488          }
00489          break;
00490       }// switch(mode)
00491    return retval;
00492 }
00493 
00494 TGo4Thread* TGo4ThreadHandler::GetThread (const char* name)
00495 {
00496    TRACE((12,"TGo4ThreadHandler::GetThread(const char*)",__LINE__, __FILE__));
00497    TGo4Thread* thread=0;
00498    {
00499       TGo4LockGuard listguard(fxListMutex);
00500       thread = (TGo4Thread*) fxArray->FindObject(name);
00501    }
00502    return thread;
00503 }
00504 
00505 Int_t TGo4ThreadHandler::GetEntries ()
00506 {
00507    TRACE((12,"TGo4ThreadHandler::GetEntries()",__LINE__, __FILE__));
00508    Int_t entries=0;
00509    {
00510    TGo4LockGuard listguard(fxListMutex);
00511       entries=fxArray->GetEntries();
00512    }
00513    return entries;
00514 }
00515 
00516 Bool_t TGo4ThreadHandler::AllCreated ()
00517 {
00518    TRACE((14,"TGo4ThreadHandler::AllCreated()",__LINE__, __FILE__));
00519    Bool_t rev=kTRUE; // return value: false if one thread is not there
00520    TGo4Thread* th=0;
00521    {
00522    TGo4LockGuard listguard(fxListMutex);
00523       fxIterator->Reset();
00524       while((th= (TGo4Thread*) fxIterator->Next())!=0)
00525          {
00526             if((th->GetPID())==0)
00527                {
00528                TRACE((11,"TGo4ThreadHandler::AllCreated() TThread is _not_ existing",__LINE__, __FILE__));
00529                rev=kFALSE; // this thread is not there
00530                break;
00531                }
00532             else
00533                {
00534                TRACE((11,"TGo4ThreadHandler::AllCreated() TThread is existing",__LINE__, __FILE__));
00535                   // thread PID found
00536                }
00537          } // while(th=...)
00538    }
00539    return rev;
00540 }
00541 
00542 Bool_t TGo4ThreadHandler::AllRunning ()
00543 {
00544    TRACE((14,"TGo4ThreadHandler::AllRunning()",__LINE__, __FILE__));
00545    Bool_t rev=kTRUE; // return value: false if one thread is not there
00546    TGo4Thread* th=0;
00547    {
00548    TGo4LockGuard listguard(fxListMutex);
00549       fxIterator->Reset();
00550       while((th= (TGo4Thread*) fxIterator->Next())!=0)
00551          {
00552          if(!(th->IsRunning()))
00553             {
00554             TRACE((11,"TGo4ThreadHandler::AllCreated() TGo4Thread is _not_ running",__LINE__, __FILE__));
00555                rev=kFALSE; // this thread is not working
00556                break;
00557             }
00558          else
00559             {
00560             TRACE((11,"TGo4ThreadHandler::AllCreated() TGo4Thread is running",__LINE__, __FILE__));
00561                // thread is working
00562             }
00563          }
00564    }
00565    return rev;
00566 }
00567 
00568 Bool_t TGo4ThreadHandler::AllWaiting ()
00569 {
00570    TRACE((14,"TGo4ThreadHandler::AllWaiting()",__LINE__, __FILE__));
00571    Bool_t rev=kTRUE; // return value: false if one runnable is still running
00572    TGo4Thread* th=0;
00573    {
00574    TGo4LockGuard listguard(fxListMutex);
00575       fxIterator->Reset();
00576       while((th= (TGo4Thread*) fxIterator->Next())!=0)
00577          {
00578          if(!(th->IsWaiting()))
00579             {
00580             TRACE((11,"TGo4ThreadHandler::AllCreated() TGo4Thread is still running",__LINE__, __FILE__));
00581                //cout <<"-------Thread "<<th->GetName()<<" is still running..." << endl;
00582                rev=kFALSE; // this runnable is still doing
00583                break;
00584             }
00585          else
00586             {
00587             TRACE((11,"TGo4ThreadHandler::AllCreated() TGo4Thread is waiting",__LINE__, __FILE__));
00588                // runnable is waiting
00589             }
00590          }
00591    }
00592    return rev;
00593 }
00594 
00595 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:07 2005 for Go4-v2.10-5 by doxygen1.2.15