MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / svc

Method svc

dds/InfoRepo/UpdateReceiver_T.cpp:130–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128
129template<class DataType>
130int
131UpdateReceiver<DataType>::svc()
132{
133 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
134 ACE_DEBUG((LM_DEBUG,
135 ACE_TEXT("(%P|%t) UpdateReceiver::svc()\n")));
136 }
137
138 // Continue until we are synchronously terminated.
139 while (this->stop_ == false) {
140 { // Block until there is work to do.
141 ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, guard, this->lock_, 0);
142
143 while (this->queue_.size() == 0) {
144 // This releases the lock while we block.
145 this->workAvailable_.wait();
146
147 if (OpenDDS::DCPS::DCPS_debug_level > 9) {
148 ACE_DEBUG((LM_DEBUG,
149 ACE_TEXT("(%P|%t) UpdateReceiver::svc() - ")
150 ACE_TEXT("wakeup in 0x%x.\n"),
151 (void*)this));
152 }
153
154 // We were asked to stop instead.
155 if (this->stop_ == true) {
156 if (OpenDDS::DCPS::DCPS_debug_level > 4) {
157 ACE_DEBUG((LM_DEBUG,
158 ACE_TEXT("(%P|%t) UpdateReceiver::svc() - ")
159 ACE_TEXT("discontinuing processing after wakeup in 0x%x.\n"),
160 (void*)this));
161 }
162
163 return 0;
164 }
165 }
166 }
167
168 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
169 ACE_DEBUG((LM_DEBUG,
170 ACE_TEXT("(%P|%t) UpdateReceiver::svc() - ")
171 ACE_TEXT("processing a sample in 0x%x.\n"),
172 (void*)this));
173 }
174
175 // Delegate actual processing to the publication manager.
176 this->processor_.processSample(
177 this->queue_.front().first,
178 this->queue_.front().second);
179
180 { // Remove the completed work.
181 ACE_GUARD_RETURN(ACE_SYNCH_MUTEX, guard, this->lock_, 0);
182 delete this->queue_.front().first;
183 delete this->queue_.front().second;
184 this->queue_.pop_front();
185 }
186 }
187

Callers

nothing calls this directly

Calls 4

processSampleMethod · 0.80
pop_frontMethod · 0.80
sizeMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected