Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Client_Leaks / Client_Task.h
blobfb03f4a5bc7e7d49f830e84c2cd14cf5326de4f4
2 #ifndef CLIENT_LEAKS_CLIENT_TASK_H
3 #define CLIENT_LEAKS_CLIENT_TASK_H
4 #include /**/ "ace/pre.h"
6 #include "TestC.h"
7 #include "ace/Task.h"
9 #if !defined (ACE_LACKS_PRAGMA_ONCE)
10 # pragma once
11 #endif /* ACE_LACKS_PRAGMA_ONCE */
13 /// Implement a Task to run the experiments using multiple threads.
14 class Client_Task : public ACE_Task_Base
16 public:
17 /// Constructor
18 Client_Task (Test::Process_Factory_ptr process_Factory,
19 int iterations);
21 /// Return the total number of successful calls
22 int successful_calls (void) const;
24 /// Thread entry point
25 int svc (void);
27 private:
28 /// Run one iteration of the test
29 int one_iteration (void);
31 /// Make sure that the thread has a connection available
32 void validate_connection (void);
34 private:
35 /// Reference to the test interface
36 Test::Process_Factory_var process_factory_;
38 /// Total number of processes created by each thread
39 int iterations_;
41 /// At least some calls must be successful
42 int successful_calls_;
44 /// Implement the Monitor Object Pattern.
45 TAO_SYNCH_MUTEX mutex_;
48 #include /**/ "ace/post.h"
49 #endif /* CLIENT_LEAKS_CLIENT_TASK_H */