blob: cd8e4074f39e41efc57a7d54418347f0dc553ea3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
/* -*- C++ -*- */
// $Id$
// ============================================================================
//
// = LIBRARY
// TAO/tests
//
// = FILENAME
// Util_Thread.h
//
// = AUTHOR
// Andy Gokhale, Sumedh Mungee, Sergio Flores-Gaitan and Nagarajan
// Surendran.
//
// ============================================================================
#if !defined (UTIL_THREAD_H)
#define UTIL_THREAD_H
#include "Task_Client.h"
class Util_Thread : public ACE_Task<ACE_NULL_SYNCH>
{
// = TITLE
// The thread that computes utilization.
public:
Util_Thread (Task_State *,
ACE_Thread_Manager *thr_mgr);
// Constructor.
virtual int svc (void);
// The thread entry point function.
u_long get_number_of_computations (void);
// Gets the number of computations the thread was able to perform.
void computation (void);
// this is the actual "computation" being performed.
int done_;
// Indicates whether we're done.
private:
int run_computations (void);
// Run the computations.
u_long number_of_computations_;
// This stores the number of computations performed
// by the Util_Thread so far
Task_State *ts_;
// Pointer to the Task state. Stores the state
// common to the multiple client threads
};
#endif /* !defined (UTIL_THREAD_H) */
|