Logo ROOT  
Reference Guide
TPosixThread.h
Go to the documentation of this file.
1 // @(#)root/thread:$Id$
2 // Author: Fons Rademakers 02/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 #ifndef ROOT_TPosixThread
13 #define ROOT_TPosixThread
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TPosixThread //
19 // //
20 // This class provides an interface to the posix thread routines. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TThreadImp.h"
25 
26 #ifndef __CINT__
27 #include <pthread.h>
28 #endif
29 
30 R__EXTERN "C" unsigned int sleep(unsigned int seconds);
31 
33 
34 
35 class TPosixThread : public TThreadImp {
36 
37 public:
40 
41  virtual Int_t Join(TThread *th, void **ret);
42  virtual Long_t SelfId();
43  virtual Int_t Run(TThread *th);
44 
45  virtual Int_t Kill(TThread *th);
46  virtual Int_t SetCancelOff();
47  virtual Int_t SetCancelOn();
48  virtual Int_t SetCancelAsynchronous();
49  virtual Int_t SetCancelDeferred();
50  virtual Int_t CancelPoint();
51  virtual Int_t CleanUpPush(void **main, void *free,void *arg);
52  virtual Int_t CleanUpPop(void **main, Int_t exe);
53  virtual Int_t CleanUp(void **main);
54 
55  virtual Int_t Exit(void *ret);
56 
57  ClassDef(TPosixThread,0) // TPosixThread class
58 };
59 
60 
62 
63 friend class TPosixThread;
64 
65 private:
66  void *fRoutine;
67  void *fArgument;
69 
70 public:
71  TPosixThreadCleanUp(void **main, void *routine, void *arg);
73 };
74 
75 #endif
TPosixThread::SelfId
virtual Long_t SelfId()
Return the thread identifier for the calling thread.
Definition: TPosixThread.cxx:182
TThread
Definition: TThread.h:40
TPosixThread::SetCancelOn
virtual Int_t SetCancelOn()
Turn on the cancellation state of the calling thread.
Definition: TPosixThread.cxx:104
TPosixThread::SetCancelAsynchronous
virtual Int_t SetCancelAsynchronous()
Set the cancellation response type of the calling thread to asynchronous, i.e.
Definition: TPosixThread.cxx:114
TPosixThreadCleanUp::fArgument
void * fArgument
Definition: TPosixThread.h:67
Int_t
int Int_t
Definition: RtypesCore.h:45
sleep
R__EXTERN C unsigned int sleep(unsigned int seconds)
TPosixThread::CleanUpPush
virtual Int_t CleanUpPush(void **main, void *free, void *arg)
Add thread cleanup function.
Definition: TPosixThread.cxx:145
TPosixThread::CleanUpPop
virtual Int_t CleanUpPop(void **main, Int_t exe)
Pop thread cleanup function from stack.
Definition: TPosixThread.cxx:156
TPosixThreadCleanUp
Definition: TPosixThread.h:61
TPosixThread::Run
virtual Int_t Run(TThread *th)
Create a pthread.
Definition: TPosixThread.cxx:31
TPosixThread::CancelPoint
virtual Int_t CancelPoint()
Introduce an explicit cancellation point. Returns 0.
Definition: TPosixThread.cxx:132
TPosixThread::~TPosixThread
~TPosixThread()
Definition: TPosixThread.h:39
Long_t
long Long_t
Definition: RtypesCore.h:54
main
int main(int argc, char **argv)
Definition: histspeedtest.cxx:751
TPosixThread::Join
virtual Int_t Join(TThread *th, void **ret)
Join suspends the execution of the calling thread until the thread identified by th terminates,...
Definition: TPosixThread.cxx:67
TPosixThreadCleanUp::~TPosixThreadCleanUp
~TPosixThreadCleanUp()
Definition: TPosixThread.h:72
TThreadImp
Definition: TThreadImp.h:31
TPosixThread::SetCancelDeferred
virtual Int_t SetCancelDeferred()
Set the cancellation response type of the calling thread to deferred, i.e.
Definition: TPosixThread.cxx:124
TPosixThread::Exit
virtual Int_t Exit(void *ret)
Terminates the execution of the calling thread. Return 0.
Definition: TPosixThread.cxx:75
TPosixThreadCleanUp::fNext
TPosixThreadCleanUp * fNext
Definition: TPosixThread.h:68
TPosixThread::CleanUp
virtual Int_t CleanUp(void **main)
Default thread cleanup routine.
Definition: TPosixThread.cxx:171
TPosixThread::TPosixThread
TPosixThread()
Definition: TPosixThread.h:38
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TPosixThread::SetCancelOff
virtual Int_t SetCancelOff()
Turn off the cancellation state of the calling thread.
Definition: TPosixThread.cxx:95
TPosixThread
Definition: TPosixThread.h:35
TThreadImp.h
R__EXTERN
#define R__EXTERN
Definition: DllImport.h:27
free
#define free
Definition: civetweb.c:1539
TPosixThreadCleanUp::TPosixThreadCleanUp
TPosixThreadCleanUp(void **main, void *routine, void *arg)
cleanup function
Definition: TPosixThread.cxx:194
TPosixThreadCleanUp::fRoutine
void * fRoutine
Definition: TPosixThread.h:66
TPosixThread::Kill
virtual Int_t Kill(TThread *th)
Cancellation is the mechanism by which a thread can terminate the execution of another thread.
Definition: TPosixThread.cxx:86