- }
- ConnectDatabases(ServerInstance);
-}
-
-void NotifyMainThread(SQLConnection* connection_with_new_result)
-{
- /* Here we write() to the socket the main thread has open
- * and we connect()ed back to before our thread became active.
- * The main thread is using a nonblocking socket tied into
- * the socket engine, so they wont block and they'll receive
- * nearly instant notification. Because we're in a seperate
- * thread, we can just use standard connect(), and we can
- * block if we like. We just send the connection id of the
- * connection back.
- */
- send(QueueFD, connection_with_new_result->GetID().c_str(), connection_with_new_result->GetID().length()+1, 0);
-}
-
-void* DispatcherThread(void* arg);
-
-/** Used by m_mysql to notify one thread when the other has a result
- */
-class Notifier : public InspSocket
-{
- insp_sockaddr sock_us;
- socklen_t uslen;
-
-
- public:
-
- /* Create a socket on a random port. Let the tcp stack allocate us an available port */
-#ifdef IPV6
- Notifier(InspIRCd* SI) : InspSocket(SI, "::1", 0, true, 3000)
-#else
- Notifier(InspIRCd* SI) : InspSocket(SI, "127.0.0.1", 0, true, 3000)
-#endif
- {
- uslen = sizeof(sock_us);
- if (getsockname(this->fd,(sockaddr*)&sock_us,&uslen))