00001 // @(#)root/thread:$Id: TThreadFactory.h 29797 2009-08-17 14:35:51Z rdm $ 00002 // Author: Fons Rademakers 01/07/97 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 00013 #ifndef ROOT_TThreadFactory 00014 #define ROOT_TThreadFactory 00015 00016 ////////////////////////////////////////////////////////////////////////// 00017 // // 00018 // TThreadFactory // 00019 // // 00020 // This ABC is a factory for thread components. Depending on which // 00021 // factory is active one gets either Posix or Win32 threads. // 00022 // // 00023 ////////////////////////////////////////////////////////////////////////// 00024 00025 #ifndef ROOT_TNamed 00026 #include "TNamed.h" 00027 #endif 00028 00029 class TMutexImp; 00030 class TConditionImp; 00031 class TThreadImp; 00032 class TThread; 00033 00034 class TThreadFactory : public TNamed { 00035 00036 public: 00037 TThreadFactory(const char *name = "Unknown", const char *title = "Unknown Thread Factory"); 00038 virtual ~TThreadFactory() { } 00039 00040 virtual TMutexImp *CreateMutexImp(Bool_t recursive) = 0; 00041 virtual TConditionImp *CreateConditionImp(TMutexImp *m) = 0; 00042 virtual TThreadImp *CreateThreadImp() = 0; 00043 00044 ClassDef(TThreadFactory,0) // Thread factory ABC 00045 }; 00046 00047 R__EXTERN TThreadFactory *gThreadFactory; 00048 00049 #endif 00050 00051 00052