Example #1
0
int main()
{
    TestCase1();
    TestCase2();
    TestCase3();
    
    
    return 0;
}
Example #2
0
// Thread 3 should run this
DWORD WINAPI Procedure3(LPVOID lpParm)
{
	InitialCode(1000); // Do not remove - for testing purposes
	printf("Thread 3 runnning...\n");
	for (int i = 0; i < 100; i++) // Do not remove - for testing purposes
	{ // Do not remove - for testing purposes
		TestCase3(); // Do not remove - for testing purposes
		RemainderCode(100); // Do not remove - for testing purposes
		TestCase8(); // Do not remove - for testing purposes
		RemainderCode(100); // Do not remove - for testing purposes
		TestCase13(); // Do not remove - for testing purposes
		RemainderCode(500); // Do not remove - for testing purposes
		SendDataToServer(3); // Do not remove - for testing purposes
		printf("Thread 3 Data Sent\n");
	} // Do not remove - for testing purposes
	return 1;
}
Example #3
0
void TestCase12()
{
	StartingFunction(12); // Do not remove - for testing purposes

	DWORD count = 0, wait5;

	// Request ownership of mutex.

	while (count < 1)
	{
		wait5 = WaitForSingleObject(mutexResource5, INFINITE);

		switch (wait5)
		{
			// The thread got ownership of the mutex
		case WAIT_OBJECT_0:
		{
			//using resources
			resource5++;
			int iTemp = StartToUseResource(5); // Do not remove - for testing purposes
			TestCase3(); // Do not remove - for testing purposes
			FinishUsingResource(5, iTemp); // Do not remove - for testing purposes

			count++;

			// Release ownership of mutex objects
			ReleaseMutex(mutexResource5);
		}
		break;

		case WAIT_ABANDONED:
			printf("Wait abandoned\n");
			break;
	}
}

	EndingFunction(12); // Do not remove - for testing purposes */
}