Logo ROOT   6.08/07
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 #ifndef ROOT_TThreadImp
25 #include "TThreadImp.h"
26 #endif
27 
28 #ifndef __CINT__
29 #include <pthread.h>
30 #endif
31 
32 R__EXTERN "C" unsigned int sleep(unsigned int seconds);
33 
35 
36 
37 class TPosixThread : public TThreadImp {
38 
39 public:
42 
43  virtual Int_t Join(TThread *th, void **ret);
44  virtual Long_t SelfId();
45  virtual Int_t Run(TThread *th);
46 
47  virtual Int_t Kill(TThread *th);
48  virtual Int_t SetCancelOff();
49  virtual Int_t SetCancelOn();
50  virtual Int_t SetCancelAsynchronous();
51  virtual Int_t SetCancelDeferred();
52  virtual Int_t CancelPoint();
53  virtual Int_t CleanUpPush(void **main, void *free,void *arg);
54  virtual Int_t CleanUpPop(void **main, Int_t exe);
55  virtual Int_t CleanUp(void **main);
56 
57  virtual Int_t Exit(void *ret);
58 
59  ClassDef(TPosixThread,0) // TPosixThread class
60 };
61 
62 
64 
65 friend class TPosixThread;
66 
67 private:
68  void *fRoutine;
69  void *fArgument;
71 
72 public:
73  TPosixThreadCleanUp(void **main, void *routine, void *arg);
75 };
76 
77 #endif
virtual Int_t CancelPoint()
Introduce an explicit cancellation point. Returns 0.
virtual Int_t Run(TThread *th)
Create a pthread.
virtual Int_t CleanUp(void **main)
Default thread cleanup routine.
virtual Int_t SetCancelOn()
Turn on the cancellation state of the calling thread.
virtual Int_t Exit(void *ret)
Terminates the execution of the calling thread. Return 0.
int Int_t
Definition: RtypesCore.h:41
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual Long_t SelfId()
Return the thread identifier for the calling thread.
virtual Int_t SetCancelDeferred()
Set the cancellation response type of the calling thread to deferred, i.e.
long Long_t
Definition: RtypesCore.h:50
#define free
Definition: civetweb.c:821
virtual Int_t Kill(TThread *th)
Cancellation is the mechanism by which a thread can terminate the execution of another thread...
R__EXTERN C unsigned int sleep(unsigned int seconds)
#define R__EXTERN
Definition: DllImport.h:27
virtual Int_t Join(TThread *th, void **ret)
Join suspends the execution of the calling thread until the thread identified by th terminates...
TPosixThreadCleanUp * fNext
Definition: TPosixThread.h:70
virtual Int_t CleanUpPush(void **main, void *free, void *arg)
Add thread cleanup function.
virtual Int_t SetCancelAsynchronous()
Set the cancellation response type of the calling thread to asynchronous, i.e.
int main(int argc, char **argv)
virtual Int_t SetCancelOff()
Turn off the cancellation state of the calling thread.
virtual Int_t CleanUpPop(void **main, Int_t exe)
Pop thread cleanup function from stack.