MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / QueueLoop

Method QueueLoop

src/FTPQueue.cpp:177–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177int FTPQueue::QueueLoop() {
178 QueueOperation * op = NULL;
179
180 while(!m_stopping) {
181
182 m_monitor->Enter();
183 while (m_queue.empty() && !m_stopping)
184 m_monitor->Wait(ConditionQueueOps);
185
186 if (m_stopping) {
187 m_monitor->Exit();
188 break;
189 }
190
191 op = m_queue.front();
192 m_activeOp = op;
193 m_performing = true;
194 m_monitor->Exit();
195
196 op->SendNotification(QueueOperation::QueueEventStart);
197 op->SetRunning(true);
198 Sleep(500);
199 op->Perform();
200 op->SetRunning(false);
201 op->SendNotification(QueueOperation::QueueEventEnd);
202
203 if (m_stopping)
204 break;
205
206 op->SendNotification(QueueOperation::QueueEventRemove);
207
208 m_monitor->Enter();
209 m_activeOp = NULL;
210 m_performing = false;
211 m_queue.pop_front();
212 delete op;
213 m_monitor->Exit();
214 }
215
216 m_monitor->Enter();
217 m_performing = false;
218 m_monitor->Signal(ConditionQueueStop);
219 m_monitor->Exit();
220
221 return 0;
222}
223
224int FTPQueue::OnDataReceived(long received, long total) {
225 m_monitor->Enter();

Callers 1

QueueThreadMethod · 0.80

Calls 8

EnterMethod · 0.80
emptyMethod · 0.80
WaitMethod · 0.80
ExitMethod · 0.80
SendNotificationMethod · 0.80
SetRunningMethod · 0.80
PerformMethod · 0.80
SignalMethod · 0.80

Tested by

no test coverage detected