Exemplo n.º 1
0
void my_CriticalSections_Multi()
{
	randomGenerator.randomize();

	for (int i=1;i<=10;i++)
		createThread( thread_example, i );

	// Wait all threads exit:
	int cnt;
	do
	{
		sleep(10);
		csCounter.enter();
		cnt = counter;
		csCounter.leave();
	} while (cnt);
}
Exemplo n.º 2
0
// TEST 1: Just test if creating a CS doesn't launch an exception or lock.
// ----------------------------------------------------------------------------
void my_CriticalSections_Simple()
{
	CCriticalSection  cs;
	cs.enter();
	cs.leave();
}