本文整理汇总了C++中CEvent::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ CEvent::Set方法的具体用法?C++ CEvent::Set怎么用?C++ CEvent::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEvent
的用法示例。
在下文中一共展示了CEvent::Set方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
inline void operator()()
{
staticThinggy = new Thinggy;
staticThreadLocal.set(staticThinggy);
waiting = true;
gate.Set();
waiter.Wait();
waiting = false;
threadLocalHadValue = staticThreadLocal.get() != NULL;
gate.Set();
}
示例2: OnNodeRepeat
virtual void OnNodeRepeat(CAcmUdp* pUdp)
{
uint32 nState = GetState();
uint32 nDomain = pUdp->GetDomain();
uint32 nNode = pUdp->GetNode();
if(nState < FOCP_SERVICE_STARTED)
{
m_bNodeRepeat = true;
m_oEvent.Set();
FocpLog(FOCP_LOG_ERROR, ("The current node(nDomain=%u, nNode=%u) is repeated with the network environment", nDomain, nNode));
}
else
FocpLog(FOCP_LOG_ERROR, ("The visitor node(nDomain=%u, nNode=%u) is repeated with the current node", nDomain, nNode));
}
示例3: t
TEST(TestThreadLocal, Simple)
{
GlobalThreadLocal runnable;
thread t(runnable);
gate.Wait();
EXPECT_TRUE(runnable.waiting);
EXPECT_TRUE(staticThinggy != NULL);
EXPECT_TRUE(staticThreadLocal.get() == NULL);
waiter.Set();
gate.Wait();
EXPECT_TRUE(runnable.threadLocalHadValue);
EXPECT_TRUE(!destructorCalled);
delete staticThinggy;
EXPECT_TRUE(destructorCalled);
cleanup();
}
示例4: ThreadFunction
unsigned __stdcall ThreadFunction( void *pParam )
{
IClient *pClient = ( IClient * )pParam;
ASSERT( pClient );
while ( !m_theQuitThreadEvent.Wait( 0 ) )
{
size_t dataLength = 0;
const void *pData = pClient->GetPackFromServer( dataLength );
if ( !pData || 0 == dataLength )
{
Sleep( 1 );
continue;
}
EXTEND_HEADER* pHeader = (EXTEND_HEADER*)pData;
if (pHeader->ProtocolFamily == pf_relay)
{
if (pHeader->ProtocolID == relay_c2c_data)
{
RELAY_DATA* pRelayCmd = (RELAY_DATA*)pData;
in_addr ia;
ia.s_addr = pRelayCmd->nFromIP;
cout << "relaydata: " << inet_ntoa(ia) << '(' << pRelayCmd->nFromRelayID << ')' << " -- recv size: " << dataLength << endl;
}
if (pHeader->ProtocolID == relay_s2c_loseway)
{
RELAY_DATA* pRelayCmd = (RELAY_DATA*)pData;
in_addr ia;
ia.s_addr = pRelayCmd->nFromIP;
cout << "loseway: " << inet_ntoa(ia) << '(' << pRelayCmd->nFromRelayID << ')' << " -- recv size: " << dataLength << endl;
}
}
}
cout << "The read thread was killed safely!" << endl;
m_theAfirmThreadQuitEvent.Set();
return 0;
}
示例5: ClientEventNotify
void __stdcall ClientEventNotify(
LPVOID lpParam,
const unsigned long &ulnEventType )
{
switch( ulnEventType )
{
case enumServerConnectCreate:
cout << "Server connection was created !" << endl;
break;
case enumServerConnectClose:
cout << "Server connection was destroy !" << endl;
m_theQuitThreadEvent.Set();
break;
}
}