コード例 #1
0
int SimulatorBaseThread :: InitThread(int instanceindex, int globalThreadID)
{
	//LogMessageL("[HTTP:%d] Address: %08X", instanceindex, this);
	ResetValues(false);
	InternalIndex = instanceindex;
	GlobalThreadID = globalThreadID;

	//Set to active now because the thread might launch and quit 
	//before it gets set to active later.

	/*
	HANDLE h = CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)SimulatorBaseThreadProc, this, 0, &ThreadID);
	if(h == NULL)
	{
		isActive = false;
		LogMessageL("[SimB] Could not create thread.");
		return 1;
	}
	*/
	int r = Platform_CreateThread(0, (void*)SimulatorBaseThreadProc, this, &ThreadID);
	if(r == 0)
	{
		isActive = false;
		g_Logs.simulator->error("[SimB] Could not create thread.");
		return 1;
	}
	return 0;
}
コード例 #2
0
ファイル: Packet.cpp プロジェクト: kgrubb/iceee
void PacketManager::LaunchThread(void) {
	if (Platform_CreateThread(0, (void*) ThreadProc, &g_PacketManager, NULL)
			== 0)
		g_Logs.server->error(
				"PacketManager::LaunchThread: error creating thread");
	else
		g_Logs.server->info("PacketManager::LaunchThread: successful");
}
コード例 #3
0
ファイル: Scheduler.cpp プロジェクト: rockfireredmoon/iceee
void Scheduler::Init() {
	/* Setup thread pool */
	for(int i = 0 ; i < POOL_SIZE; i++) {
		PooledWorker *worker = new PooledWorker(i);
		if(Platform_CreateThread(0, (void*)worker->ThreadProc, worker, NULL) == 0) {
			g_Logs.server->error("Failed to create worker thread %v", i);
		}
		else {
			workers.push_back(worker);
		}
	}
}
コード例 #4
0
ファイル: Packet.cpp プロジェクト: Wuffie12/iceee
void PacketManager :: LaunchThread(void)
{
	int res = Platform_CreateThread(0, (void*)ThreadProc, &g_PacketManager, NULL);
	g_Log.AddMessageFormatW(MSG_ERROR, "PacketManager::LaunchThread: %s ", (res == 0) ? "error creating thread" : "successful");
}