示例#1
0
void t0(void * dummy)
{
  printf("\nt0 start\n");
  makeThreads("t0", t1, n);
  printf("\nt0 end\n");
  MyThreadExit();
}
示例#2
0
void t1(void * who_)
{
  char me[16];
  int who = (int)who_;
  sprintf(me, "t1 %d", who);
  printf("\n%s start\n", me);
  makeThreads(me, t2, m);
  printf("\nt1 %d end\n", who);
  MyThreadExit();
}
示例#3
0
Server::Server(int port, bool debug) {
	// setup variables
	port_ = port;
	this->debug = debug;
	buffer = Buffer();
	sem_init(&serverLock, 0, 1);

	// create and run the server
	create();
	makeThreads(NUMTHREADS);
	serve();
}
示例#4
0
void SMTController::run()
{
	assert(m_uiNumber);
	assert(m_szFile);

	fillFileList();
	m_pUPThread->start();

	if (!makeThreads())
		return;

	for (size_t x=0; x<m_vWorkerList.size(); x++)
		m_vWorkerList[x]->workThread->start();

	while (true)
	{
		doPause();

		if (isStopped())
			break;

		//wait here as we have nothing else to do
		m_WaitCond.wait(2);

		if (m_iRunningWorkers==0)
			break;
	}

	m_pUPThread->stop();

	for (size_t x=0; x<m_vWorkerList.size(); x++)
		m_vWorkerList[x]->workThread->stop();

	if (!isStopped())
		postProcessing();

	safe_delete(m_vWorkerList);
}
示例#5
0
ChThreadsPOSIX::ChThreadsPOSIX(ChThreadConstructionInfo& threadConstructionInfo)
{
    makeThreads(threadConstructionInfo);
}
示例#6
0
ChThreadsWIN32::ChThreadsWIN32(ChThreadConstructionInfo& threadConstructionInfo)
{
	makeThreads(threadConstructionInfo);
}