Example #1
0
void Server::start()
{
	lock.lock();
	if(!started && runn)
	{
		started = true;
		if(mode==1)
		{
			if(fork()==0)
			{
				servicing(this);
			}
		}
		else if(mode==2)
		{
			Thread servicing_thread(&servicing, this);
			servicing_thread.execute();
		}
		else if(mode==3)
		{
			servicing(this);
		}
	}
	lock.unlock();
}
Example #2
0
void NBServer::start()
{
	lock.lock();
	if(!started && runn)
	{
		started = true;
		Thread servicing_thread(&servicing, this);
		servicing_thread.execute();
	}
	lock.unlock();
}