why does thread 1 gets suspended?
Code:#include <windows.h> HANDLE mModuleManager; void Thread1() { while(1>0) { WaitForSingleObject(mModuleManagerInput, INFINITE); mModuleManagerInput=CreateMutex(NULL,TRUE, "mModuleManagerInput"); cout<<"test_working"; pModuleManager->Out(pModuleManager->InputQueue.Read()->info, Char ); ReleaseMutex(mModuleManagerInput); } } ... void Thread2() { while (1>0) { cin>>Input; cin.ignore(); WaitForSingleObject(mModuleManagerInput, INFINITE); mModuleManagerInput=CreateMutex(NULL,TRUE, "mModuleManagerInput"); ModuleManager.InputQueue.Input(CreateData((void*) Input, Char )); ReleaseMutex(mModuleManagerInput); } }



LinkBack URL
About LinkBacks


