commit 2025-10-04 14:32 edit a bit ZCppMain/ZCProcess.H

This commit is contained in:
2025-10-04 14:32:09 +09:00
parent 72f23aa514
commit 939d1cc007
3 changed files with 24 additions and 25 deletions

View File

@ -1001,7 +1001,7 @@ namespace ZNsMain
typename TDataArg =const TSyncData& ,
typename TSyncEasy=ZNsMain::ZCCriticSectEasy
>
class ZtCSyncObj ////////////////////////////////*/
class ZtCSyncObj /////////////////////////////////////*/
/*/////////////////////////////////////////////////////////////////////////////
@ -1021,13 +1021,13 @@ namespace ZNsMain
typedef TMutexCondData CMutexCondData;
protected:
bool mb_MustWait;
bool mb_DoWaitCond;
bool mb_WaitCond;
public :
ZtCMutexCondDataVar()
{
mb_MustWait= false;
mb_DoWaitCond=false;
mb_WaitCond= false;
}/*
ZtCMutexCondDataVar()*/
@ -1039,9 +1039,9 @@ namespace ZNsMain
{
if(this->mb_MustWait==true)
{
this->mb_DoWaitCond=true ;
this->mb_WaitCond=true ;
this->TMutexCondData::WaitCond();
this->mb_DoWaitCond=false;
this->mb_WaitCond=false;
}/*
if(this->mb_MustWait==true)*/
}
@ -1064,14 +1064,14 @@ namespace ZNsMain
{
// nothing to do
}
else if(this->mb_DoWaitCond==true)
else if(this->mb_WaitCond==true)
{
// 이때는 쓰레드가 잠자고 있다면 깨워야 한다.
this->TMutexCondData::WakeCond();
this->mb_DoWaitCond=false;
this->mb_WaitCond=false;
}/*
else if(this->mb_DoWaitCond==true)*/
else if(this->mb_WaitCond==true)*/
}
this->TMutexCondData::UnLock();
}/*
@ -1079,7 +1079,7 @@ namespace ZNsMain
bool MustWait () const{return mb_MustWait;}
bool DoWaitCond() const{return mb_DoWaitCond;}
bool DoWaitCond() const{return mb_WaitCond;}
public:
};/*

View File

@ -4013,8 +4013,8 @@ namespace ZNsMain
// 실험용 코드.
bool VB_IsOK1=::pthread_mutex_init(&mh_Mutex, AP_MutexAttr)==ZNsMain::ZNsEnum::ZEThread_OK;
bool VB_IsOK2=::pthread_cond_init (&mh_Cond, AP_CondAttr )==ZNsMain::ZNsEnum::ZEThread_OK;
bool VB_IsOK1= (::pthread_mutex_init(&mh_Mutex, AP_MutexAttr)==ZNsMain::ZNsEnum::ZEThread_OK);
bool VB_IsOK2= (::pthread_cond_init (&mh_Cond, AP_CondAttr )==ZNsMain::ZNsEnum::ZEThread_OK);
return (VB_IsOK1 && VB_IsOK2) ? ZNsMain::ZNsEnum::ZEThread_OK : ZNsMain::ZNsEnum::ZEThread_Invalid ;
@ -4144,8 +4144,8 @@ namespace ZNsMain
// 실험용 코드.
bool VB_IsOK1=::pthread_cond_destroy (&mh_Cond )==ZNsMain::ZNsEnum::ZEThread_OK;
bool VB_IsOK2=::pthread_mutex_destroy(&mh_Mutex)==ZNsMain::ZNsEnum::ZEThread_OK;
bool VB_IsOK1= (::pthread_cond_destroy (&mh_Cond )==ZNsMain::ZNsEnum::ZEThread_OK);
bool VB_IsOK2= (::pthread_mutex_destroy(&mh_Mutex)==ZNsMain::ZNsEnum::ZEThread_OK);
return (VB_IsOK1 && VB_IsOK2) ? ZNsMain::ZNsEnum::ZEThread_OK : ZNsMain::ZNsEnum::ZEThread_Invalid ;

View File

@ -2365,8 +2365,7 @@ namespace ZNsMain
if(::InitializeCriticalSectionEx(&mo_CritSect, ESpinCount, 0)==TRUE)
return ZNsEnum::ZEThread_OK ;
else
return ZNsEnum::ZEThread_Invalid;
else return ZNsEnum::ZEThread_Invalid;
}/*
int InitCond()*/
@ -2497,8 +2496,8 @@ namespace ZNsMain
}/*
if(mb_IsOnWait==false)*/
DWORD VI_Return = ::SignalObjectAndWait(
mh_MutexSync, mh_EventWait, ADW_TimeOut, FALSE);
DWORD VI_Return = ::SignalObjectAndWait
( mh_MutexSync, mh_EventWait, ADW_TimeOut, FALSE );
#if(_CODE_BAD_)
return (VI_Return==WAIT_OBJECT_0) ? Lock() : VI_Return;