示例#1
0
/* Sphinx_Thread::clear: free thread */
void Sphinx_Thread::clear()
{
   if(m_thread >= 0) {
      if(m_recog)
         delete m_recog;
      glfwWaitThread(m_thread, GLFW_WAIT);
      glfwDestroyThread(m_thread);
      glfwTerminate();
   }
   if (m_recog) {
      //ps_free(m_recog); /* m_config is also released in ps_free */
   }

   if(m_languageModel != NULL)
      free(m_languageModel);
   if(m_dictionary != NULL)
      free(m_dictionary);
   if(m_acousticModel != NULL)
      free(m_acousticModel);
   if(m_configFile != NULL)
      free(m_configFile);
   if(m_logFolder != NULL)
      free(m_logFolder);

   initialize();
}
示例#2
0
/* Audio_Thread::clear: free thread */
void Audio_Thread::clear()
{
   stop();
   m_kill = true;

   /* wait */
   if(m_cond != NULL)
      glfwSignalCond(m_cond);

   if(m_mutex != NULL || m_cond != NULL || m_thread >= 0) {
      if(m_thread >= 0) {
         glfwWaitThread(m_thread, GLFW_WAIT);
         glfwDestroyThread(m_thread);
      }
      if(m_cond != NULL)
         glfwDestroyCond(m_cond);
      if(m_mutex != NULL)
         glfwDestroyMutex(m_mutex);
      glfwTerminate();
   }

   if(m_alias) free(m_alias);
   if(m_file) free(m_file);

   initialize();
}
示例#3
0
void kill_process(int pid)
{
	if(!kiss_init())
		return;

	glfwDestroyThread(pid);
}
/* Audio_Manager::clear: clear */
void Audio_Manager::clear()
{
   Audio_Link *tmp1, *tmp2;

   m_kill = true;

   /* stop and release all thread */
   for(tmp1 = m_list; tmp1; tmp1 = tmp2) {
      tmp2 = tmp1->next;
      tmp1->audio_thread.stopAndRelease();
      delete tmp1;
   }

   /* wait */
   if(m_cond != NULL)
      glfwSignalCond(m_cond);

   if(m_mutex != NULL || m_cond != NULL || m_thread >= 0) {
      if(m_thread >= 0) {
         glfwWaitThread(m_thread, GLFW_WAIT);
         glfwDestroyThread(m_thread);
      }
      if(m_cond != NULL)
         glfwDestroyCond(m_cond);
      if(m_mutex != NULL)
         glfwDestroyMutex(m_mutex);
      glfwTerminate();
   }

   Audio_EventQueue_clear(&m_bufferQueue);

   initialize();
}
/* Julius_Thread::clear: free thread */
void Julius_Thread::clear()
{
   if(m_thread >= 0) {
      if(m_recog)
         j_close_stream(m_recog);
      glfwWaitThread(m_thread, GLFW_WAIT);
      glfwDestroyThread(m_thread);
      glfwTerminate();
   }
   if (m_recog) {
      j_recog_free(m_recog); /* jconf is also released in j_recog_free */
   } else if (m_jconf) {
      j_jconf_free(m_jconf);
   }

   if(m_languageModel != NULL)
      free(m_languageModel);
   if(m_dictionary != NULL)
      free(m_dictionary);
   if(m_acousticModel != NULL)
      free(m_acousticModel);
   if(m_triphoneList != NULL)
      free(m_triphoneList);
   if(m_configFile != NULL)
      free(m_configFile);
   if(m_userDictionary != NULL)
      free(m_userDictionary);

   initialize();
}
示例#6
0
void Thread_Manager::Kill(ThreadID threadID) {
	logWrite("Killed thread (ThreadID[0x%x])",threadID);
	glfwDestroyThread(threadID);
}