- LoggingMutex = ServerInstance->Mutexes->CreateMutex();
- ResultsMutex = ServerInstance->Mutexes->CreateMutex();
- QueueMutex = ServerInstance->Mutexes->CreateMutex();
-
- ServerInstance->Modules->UseInterface("SQLutils");
-
- if (!ServerInstance->Modules->PublishFeature("SQL", this))
- {
- throw ModuleException("m_mssql: Unable to publish feature 'SQL'");
- }
-
- /* Create a socket on a random port. Let the tcp stack allocate us an available port */
-#ifdef IPV6
- listener = new MsSQLListener(this, ServerInstance, 0, "::1");
-#else
- listener = new MsSQLListener(this, ServerInstance, 0, "127.0.0.1");
-#endif
-
- if (listener->GetFd() == -1)
- {
- ServerInstance->Modules->DoneWithInterface("SQLutils");
- throw ModuleException("m_mssql: unable to create ITC pipe");
- }
- else
- {
- LoggingMutex->Lock();
- ServerInstance->Logs->Log("m_mssql", DEBUG, "MsSQL: Interthread comms port is %d", listener->GetPort());
- LoggingMutex->Unlock();
- }
+ LoggingMutex = new Mutex();
+ ResultsMutex = new Mutex();
+ queryDispatcher = new QueryThread(this);
+ }