Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TPosixThreadFactory.cxx
Go to the documentation of this file.
1// @(#)root/thread:$Id$
2// Author: Fons Rademakers 01/07/97
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12//////////////////////////////////////////////////////////////////////////
13// //
14// TPosixThreadFactory //
15// //
16// This is a factory for Posix thread components. //
17// //
18//////////////////////////////////////////////////////////////////////////
19
20#include "TPosixThreadFactory.h"
21#include "TPosixMutex.h"
22#include "TPosixCondition.h"
23#include "TPosixThread.h"
24
25// Force creation of TPosixThreadFactory when shared library will be loaded
26// (don't explicitly create a TPosixThreadFactory).
28
30
31////////////////////////////////////////////////////////////////////////////////
32/// Create Posix thread factory. Also sets global gThreadFactory to this.
33
34TPosixThreadFactory::TPosixThreadFactory(const char *name, const char *title) :
35 TThreadFactory(name, title)
36{
37 gThreadFactory = this;
38}
39
40////////////////////////////////////////////////////////////////////////////////
41/// Return a Posix Mutex.
42
44{
45 return new TPosixMutex(recursive);
46}
47
48////////////////////////////////////////////////////////////////////////////////
49/// Return a Posix thread.
50
52{
53 return new TPosixThread;
54}
55
56////////////////////////////////////////////////////////////////////////////////
57/// Return a Posix condition variable.
58
60{
61 return new TPosixCondition(m);
62}
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
#define ClassImp(name)
Definition Rtypes.h:382
char name[80]
Definition TGX11.cxx:110
static TPosixThreadFactory gPosixThreadFactoryCreator
R__EXTERN TThreadFactory * gThreadFactory
TPosixThreadFactory(const char *name="Posix", const char *title="Posix Thread Factory")
Create Posix thread factory. Also sets global gThreadFactory to this.
TThreadImp * CreateThreadImp() override
Return a Posix thread.
TMutexImp * CreateMutexImp(Bool_t recursive) override
Return a Posix Mutex.
TConditionImp * CreateConditionImp(TMutexImp *m) override
Return a Posix condition variable.
TMarker m
Definition textangle.C:8