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

Method SendNotification

src/QueueOperation.cpp:82–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82int QueueOperation::SendNotification(QueueEvent event) {
83 UINT msg = 0;
84 if (event != QueueEventProgress && (m_notifSent & event) != 0)
85 return 0; //do not send duplicate notifications, except for progress
86
87 m_notifSent |= event;
88
89 switch(event) {
90 case QueueEventStart:
91 msg = NotifyMessageStart;
92 break;
93 case QueueEventEnd:
94 msg = NotifyMessageEnd;
95 break;
96 case QueueEventAdd:
97 msg = NotifyMessageAdd;
98 break;
99 case QueueEventRemove:
100 msg = NotifyMessageRemove;
101 break;
102 case QueueEventProgress:
103 msg = NotifyMessageProgress;
104 break;
105 default:
106 return -1;
107 break;
108 }
109
110 DWORD curThread = GetCurrentThreadId();
111 if (m_winThread == curThread) {
112 ::SendMessage(m_hNotify, msg, m_notifyCode, (LPARAM)this);
113 return 0;
114 }
115
116 m_ackMonitor.Enter();
117 if (m_terminating) {
118 m_ackMonitor.Exit();
119 return 0;
120 }
121
122 ::PostMessage(m_hNotify, msg, m_notifyCode, (LPARAM)this);
123 m_ackMonitor.Wait(QueueConditionAcked);
124 m_ackMonitor.Exit();
125
126 return 0;
127}
128
129int QueueOperation::AckNotification() {
130 m_ackMonitor.Enter();

Callers 8

DeinitializeMethod · 0.80
AddQueueOpMethod · 0.80
ClearQueueMethod · 0.80
CancelQueueOpMethod · 0.80
QueueLoopMethod · 0.80
OnDataReceivedMethod · 0.80
OnDataSentMethod · 0.80
ClearMethod · 0.80

Calls 3

EnterMethod · 0.80
ExitMethod · 0.80
WaitMethod · 0.80

Tested by

no test coverage detected