Exemplo n.º 1
0
ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) {
#ifdef _WINDOWS
	SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
#endif
	if (tmp == 0) {
		THREAD_RETURN(nullptr);
	}
	BaseTCPServer* tcps = (BaseTCPServer*) tmp;

#ifndef WIN32
	_log(COMMON__THREADS, "Starting TCPServerLoop with thread ID %d", pthread_self());
#endif

	tcps->MLoopRunning.lock();
	while (tcps->RunLoop()) {
		Sleep(SERVER_LOOP_GRANULARITY);
		tcps->Process();
	}
	tcps->MLoopRunning.unlock();

#ifndef WIN32
	_log(COMMON__THREADS, "Ending TCPServerLoop with thread ID %d", pthread_self());
#endif

	THREAD_RETURN(nullptr);
}
Exemplo n.º 2
0
thread_return_t BaseTCPServer::TCPServerLoop( void* arg )
{
    BaseTCPServer* tcps = reinterpret_cast<BaseTCPServer*>( arg );
    assert( tcps != NULL );

    THREAD_RETURN( tcps->TCPServerLoop() );
}
Exemplo n.º 3
0
ThreadReturnType BaseTCPServer::TCPServerLoop( void* arg )
{
	BaseTCPServer* tcps = reinterpret_cast<BaseTCPServer*>( arg );
    assert( tcps != NULL );

    return tcps->TCPServerLoop();
}