uint32 FRunnableThreadPThread::Run()
{
	// Assume we'll fail init
	uint32 ExitCode = 1;
	check(Runnable);

	// Initialize the runnable object
	if (Runnable->Init() == true)
	{
		// Initialization has completed, release the sync event
		ThreadInitSyncEvent->Trigger();

		// Setup TLS for this thread, used by FTlsAutoCleanup objects.
		SetTls();

		// Now run the task that needs to be done
		ExitCode = Runnable->Run();
		// Allow any allocated resources to be cleaned up
		Runnable->Exit();

#if STATS
		FThreadStats::Shutdown();
#endif
		FreeTls();
	}
	else
	{
		// Initialization has failed, release the sync event
		ThreadInitSyncEvent->Trigger();
	}

	return ExitCode;
}
/**
 * Destructor
 */
CDummyWapStack::~CDummyWapStack()
	{
	FreeTls();
	iInstance =NULL;
	iObserver.DWSOServerShutDown();

	__ASSERT_DEBUG(iSessionsArray.Count()==0, User::Panic(_L("Session Not deleted  != 0"), 0));
	iSessionsArray.Close();
	}
uint32 FRunnableThreadWin::Run()
{
	uint32 ExitCode = 1;
	if (Runnable->Init())
	{
		ThreadInitSyncEvent->Trigger();

		SetTls();

		ExitCode = Runnable->Run();

		Runnable->Exit();

		FreeTls();
	}
	else
	{
		ThreadInitSyncEvent->Trigger();
	}
	return ExitCode;
}