blob: 4bd2b296eef515df025fc8b53868d94c5333dbc6 (
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
58
59
60
61
62
63
64
65
66
67
|
#ifndef BIG_REQUEST_MUXING_CLIENT_TASK_H
#define BIG_REQUEST_MUXING_CLIENT_TASK_H
#include /**/ "ace/pre.h"
#include "TestC.h"
#include "tao/Messaging/Messaging.h"
#include "ace/Task.h"
#include "ace/SString.h"
#include "ace/OS_NS_unistd.h"
#include "ace/Atomic_Op.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 (ACE_Thread_Manager *thr_mgr,
Test::Payload_Receiver_ptr receiver,
CORBA::Long event_count,
CORBA::ULong event_size,
CORBA::ORB_ptr orb,
Messaging::SyncScope sync_scope,
const ACE_CString& ident);
/// Thread entry point
int svc (void);
bool done(void) const;
const char *ID (void) const;
private:
/// Make sure that all threads have connections available to
/// workaround bug 189
void validate_connection (void);
private:
/// Reference to the test interface
Test::Payload_Receiver_var payload_receiver_;
/// Total number of events
CORBA::Long event_count_;
/// Size of each message
CORBA::ULong event_size_;
/// Keep a reference to the ORB, used to initialize the SyncScope
/// policy
CORBA::ORB_var orb_;
/// The SyncScope used in this Task
Messaging::SyncScope sync_scope_;
/// Track the number of tasks still running.
ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> tasks_running_;
bool done_;
ACE_CString id_;
};
#include /**/ "ace/post.h"
#endif /* BIG_REQUEST_MUXING_CLIENT_TASK_H */
|