| 128 | |
| 129 | template<class DataType> |
| 130 | int |
| 131 | UpdateReceiver<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 |
nothing calls this directly
no test coverage detected