WaitForSingleObject(S_Empty, INFINITE);
WaitForSingleObject(S_InputMutex, INFINITE);
g_pInputQueue->push();
ReleaseSemaphore(S_InputMutex, 1, NULL);
ReleaseSemaphore(S_Full, 1, NULL);
//
WaitForSingleObject(S_Full, INFINITE);
WaitForSingleObject(S_InputMutex, INFINITE);
g_pInputQueue->pop();
ReleaseSemaphore(S_InputMutex, 1, NULL);
ReleaseSemaphore(S_Empty, 1, NULL);
WaitForSingleObject(S_InputMutex, INFINITE);
g_pInputQueue->push();
ReleaseSemaphore(S_InputMutex, 1, NULL);
ReleaseSemaphore(S_Full, 1, NULL);
//
WaitForSingleObject(S_Full, INFINITE);
WaitForSingleObject(S_InputMutex, INFINITE);
g_pInputQueue->pop();
ReleaseSemaphore(S_InputMutex, 1, NULL);
ReleaseSemaphore(S_Empty, 1, NULL);