00001 // @(#)root/thread:$Id: TWin32ThreadFactory.cxx 29797 2009-08-17 14:35:51Z rdm $ 00002 // Author: Bertrand Bellenot 20/10/2004 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2004, 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 // // 00014 // TWin32ThreadFactory // 00015 // // 00016 // This is a factory for Win32 thread components. // 00017 // // 00018 ////////////////////////////////////////////////////////////////////////// 00019 00020 #include "TWin32ThreadFactory.h" 00021 #include "TWin32Mutex.h" 00022 #include "TWin32Condition.h" 00023 #include "TWin32Thread.h" 00024 00025 // Force creation of TWin32ThreadFactory when shared library will be loaded 00026 // (don't explicitely create a TWin32ThreadFactory). 00027 static TWin32ThreadFactory gWin32ThreadFactoryCreator; 00028 00029 ClassImp(TWin32ThreadFactory) 00030 00031 //______________________________________________________________________________ 00032 TWin32ThreadFactory::TWin32ThreadFactory(const char *name, const char *title) : 00033 TThreadFactory(name, title) 00034 { 00035 // Create Win32 thread factory. Also sets global gThreadFactory to this. 00036 00037 gThreadFactory = this; 00038 } 00039 00040 //______________________________________________________________________________ 00041 TMutexImp *TWin32ThreadFactory::CreateMutexImp(Bool_t recursive) 00042 { 00043 // Return a Win32 Mutex. 00044 00045 return new TWin32Mutex(recursive); 00046 } 00047 00048 //______________________________________________________________________________ 00049 TThreadImp *TWin32ThreadFactory::CreateThreadImp() 00050 { 00051 // Return a Win32 thread. 00052 00053 return new TWin32Thread; 00054 } 00055 00056 //______________________________________________________________________________ 00057 TConditionImp *TWin32ThreadFactory::CreateConditionImp(TMutexImp *m) 00058 { 00059 // Return a Win32 condition variable. 00060 00061 return new TWin32Condition(m); 00062 }