The Producer-Consumer Problem

xiaoxiao2021-03-06  90

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);

ReleaseseSemaphore (S_EMPTY, 1, NULL);

转载请注明原文地址:https://www.9cbs.com/read-107116.html

New Post(0)