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

Method Deinitialize

src/FTPQueue.cpp:56–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56int FTPQueue::Deinitialize() {
57 if (!m_running)
58 return 0;
59
60 //Notifications sent from this function are handled immediatly, since they're from the local thread.
61 //Therefore, peekmessage won't remove any messages that this function sent, as they won;t be queued
62
63 m_monitor->Enter();
64 m_stopping = true;
65
66 if (m_performing) {
67 m_queue.front()->Terminate();
68 m_queue.front()->SendNotification(QueueOperation::QueueEventEnd);
69 //m_queue.front()->SendNotification(QueueOperation::QueueEventRemove);
70 }
71
72 m_monitor->Signal(ConditionQueueOps);
73 m_monitor->Wait(ConditionQueueStop);
74 m_monitor->Exit();
75
76 while (!m_queue.empty()) {
77 //Remove any remaining messages (most notably Progress messages)
78 m_queue.front()->ClearPendingNotifications();
79 m_queue.front()->SendNotification(QueueOperation::QueueEventRemove);
80 delete m_queue.front();
81 m_queue.pop_front();
82 }
83
84 m_running = false;
85 m_stopping = false;
86 m_performing = false;
87
88 return 0;
89}
90
91int FTPQueue::AddQueueOp(QueueOperation * op) {
92 op->SetClient(m_wrapper);

Callers 1

ClearMethod · 0.45

Calls 8

EnterMethod · 0.80
TerminateMethod · 0.80
SendNotificationMethod · 0.80
SignalMethod · 0.80
WaitMethod · 0.80
ExitMethod · 0.80
emptyMethod · 0.80

Tested by

no test coverage detected