Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
32 class TPosixThreadCleanUp;
33 
34 
35 class TPosixThread : public TThreadImp {
36 
37 public:
38  TPosixThread() { }
39  ~TPosixThread() { }
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 
61 class TPosixThreadCleanUp {
62 
63 friend class TPosixThread;
64 
65 private:
66  void *fRoutine;
67  void *fArgument;
68  TPosixThreadCleanUp *fNext;
69 
70 public:
71  TPosixThreadCleanUp(void **main, void *routine, void *arg);
72  ~TPosixThreadCleanUp() { }
73 };
74 
75 #endif