当前位置: 首页>>代码示例>>C++>>正文


C++ CEvent::Set方法代码示例

本文整理汇总了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();
  }
开发者ID:Foozle303,项目名称:xbmc,代码行数:12,代码来源:TestThreadLocal.cpp

示例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));
	}
开发者ID:nightstyles,项目名称:focp,代码行数:14,代码来源:AcmService.cpp

示例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();
}
开发者ID:0xheart0,项目名称:xbmc,代码行数:17,代码来源:TestThreadLocal.cpp

示例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;
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:45,代码来源:testRelayServer.cpp

示例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;
	}
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:18,代码来源:testRelayServer.cpp


注:本文中的CEvent::Set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。