Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include <pthread.h>
27
28R__EXTERN "C" unsigned int sleep(unsigned int seconds);
29
31
32
33class TPosixThread : public TThreadImp {
34
35public:
38
39 Int_t Join(TThread *th, void **ret) override;
40 Long_t SelfId() override;
41 Int_t Run(TThread *th, const int affinity = -1) override;
42
43 Int_t Kill(TThread *th) override;
44 Int_t SetCancelOff() override;
45 Int_t SetCancelOn() override;
47 Int_t SetCancelDeferred() override;
48 Int_t CancelPoint() override;
49 Int_t CleanUpPush(void **main, void *free,void *arg) override;
50 Int_t CleanUpPop(void **main, Int_t exe) override;
51 Int_t CleanUp(void **main) override;
52
53 Int_t Exit(void *ret) override;
54
55 ClassDefOverride(TPosixThread,0) // TPosixThread class
56};
57
58
60
61friend class TPosixThread;
62
63private:
64 void *fRoutine;
65 void *fArgument;
67
68public:
69 TPosixThreadCleanUp(void **main, void *routine, void *arg);
71};
72
73#endif
#define R__EXTERN
Definition DllImport.h:26
int main()
Definition Prototype.cxx:12
int Int_t
Definition RtypesCore.h:45
long Long_t
Definition RtypesCore.h:54
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
R__EXTERN C unsigned int sleep(unsigned int seconds)
#define free
Definition civetweb.c:1539
TPosixThreadCleanUp * fNext
Int_t SetCancelOn() override
Turn on the cancellation state of the calling thread.
Int_t SetCancelOff() override
Turn off the cancellation state of the calling thread.
Int_t SetCancelAsynchronous() override
Set the cancellation response type of the calling thread to asynchronous, i.e.
Int_t CleanUpPop(void **main, Int_t exe) override
Pop thread cleanup function from stack.
Int_t Kill(TThread *th) override
Cancellation is the mechanism by which a thread can terminate the execution of another thread.
Int_t CleanUpPush(void **main, void *free, void *arg) override
Add thread cleanup function.
Int_t CleanUp(void **main) override
Default thread cleanup routine.
Int_t Exit(void *ret) override
Terminates the execution of the calling thread. Return 0.
Int_t SetCancelDeferred() override
Set the cancellation response type of the calling thread to deferred, i.e.
Int_t Run(TThread *th, const int affinity=-1) override
Create a pthread.
Long_t SelfId() override
Return the thread identifier for the calling thread.
Int_t Join(TThread *th, void **ret) override
Join suspends the execution of the calling thread until the thread identified by th terminates,...
Int_t CancelPoint() override
Introduce an explicit cancellation point. Returns 0.
<div class="legacybox"><h2>Legacy Code</h2> TThread is a legacy interface: there will be no bug fixes...
Definition TThread.h:40