blob: fb03f4a5bc7e7d49f830e84c2cd14cf5326de4f4 (
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
|
#ifndef CLIENT_LEAKS_CLIENT_TASK_H
#define CLIENT_LEAKS_CLIENT_TASK_H
#include /**/ "ace/pre.h"
#include "TestC.h"
#include "ace/Task.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
/// Implement a Task to run the experiments using multiple threads.
class Client_Task : public ACE_Task_Base
{
public:
/// Constructor
Client_Task (Test::Process_Factory_ptr process_Factory,
int iterations);
/// Return the total number of successful calls
int successful_calls (void) const;
/// Thread entry point
int svc (void);
private:
/// Run one iteration of the test
int one_iteration (void);
/// Make sure that the thread has a connection available
void validate_connection (void);
private:
/// Reference to the test interface
Test::Process_Factory_var process_factory_;
/// Total number of processes created by each thread
int iterations_;
/// At least some calls must be successful
int successful_calls_;
/// Implement the Monitor Object Pattern.
TAO_SYNCH_MUTEX mutex_;
};
#include /**/ "ace/post.h"
#endif /* CLIENT_LEAKS_CLIENT_TASK_H */
|