@@ -111,11 +111,6 @@ EventListener::EventListener(Attachment& attachment, const std::vector<std::stri
111111 &statusWrapper, &firebirdCallback, static_cast <unsigned >(eventBuffer.size ()), eventBuffer.data ()));
112112
113113 dispatcher = std::thread{&EventListener::dispatchLoop, this };
114-
115- { // scope
116- std::unique_lock mutexGuard{mutex};
117- condition.wait (mutexGuard, [this ] { return initialized || !listening; });
118- }
119114}
120115
121116bool EventListener::isListening () noexcept
@@ -191,7 +186,6 @@ void EventListener::handleEvent(unsigned length, const std::uint8_t* events)
191186 unsigned copyLength = 0 ;
192187 bool notify = false ;
193188 bool shouldRequeue = false ;
194- bool notifyInitialized = false ;
195189
196190 { // scope
197191 std::lock_guard mutexGuard{mutex};
@@ -249,7 +243,6 @@ void EventListener::handleEvent(unsigned length, const std::uint8_t* events)
249243 if (listening)
250244 {
251245 listening = false ;
252- initialized = true ;
253246 condition.notify_all ();
254247 }
255248
@@ -274,7 +267,6 @@ void EventListener::handleEvent(unsigned length, const std::uint8_t* events)
274267 return ;
275268
276269 listening = false ;
277- initialized = true ;
278270 condition.notify_all ();
279271 }
280272
@@ -290,17 +282,8 @@ void EventListener::handleEvent(unsigned length, const std::uint8_t* events)
290282 {
291283 previousHandle = std::move (eventsHandle);
292284 eventsHandle = std::move (newHandle);
293-
294- if (!initialized)
295- {
296- initialized = true ;
297- notifyInitialized = true ;
298- }
299285 }
300286 }
301-
302- if (notifyInitialized)
303- condition.notify_all ();
304287 }
305288 catch (...)
306289 {
@@ -313,7 +296,6 @@ void EventListener::handleEvent(unsigned length, const std::uint8_t* events)
313296 if (listening)
314297 {
315298 listening = false ;
316- initialized = true ;
317299 condition.notify_all ();
318300 }
319301 }
0 commit comments