+ boost::mutex::scoped_lock output_lock(m_p->m_mutex_output_data);
+ m_p->m_output.push_back(out);
+#ifdef WIN32
+ send(m_p->m_pipe.write_fd(), "", 1, 0);
+#else
+ ssize_t r = write(m_p->m_pipe.write_fd(), "", 1);
+ if (r != 1)
+ {
+ if (r == (ssize_t) (-1))
+ yaz_log(YLOG_WARN|YLOG_ERRNO,
+ "ThreadPoolSocketObserver::run. write fail");
+ else
+ yaz_log(YLOG_WARN,
+ "ThreadPoolSocketObserver::run. write returned 0");
+ }
+#endif
+ }
+ }
+}
+
+void ThreadPoolSocketObserver::cleanup(IThreadPoolMsg *m, void *info)
+{
+ boost::mutex::scoped_lock input_lock(m_p->m_mutex_input_data);
+
+ std::deque<IThreadPoolMsg *>::iterator it = m_p->m_input.begin();
+ while (it != m_p->m_input.end())
+ {
+ if ((*it)->cleanup(info))
+ {
+ delete *it;
+ it = m_p->m_input.erase(it);