贝贝花花包包店,精品555皮具,钱夹,皮夹

字体:  

请教一个问题:关于轮询所有Event_Handle的问题

bowei_wang 发表于: 2008-4-16 16:13 来源: ACE 开发者

reactor 的run_event_loop的逻辑如下:

    ACE_thread_t thread_t = ACE_OS::thr_self ();
    this->owner (ACE_OS::thr_self ());
    while (true)
    {
        int result = this->implementation_->handle_events ();

        if (eh != 0 && (*eh)(this))
            continue;
        else if (result == -1 && this->implementation_->deactivated ())
            return 0;
        else if (result == -1)
            return -1;
    }

    ACE_NOTREACHED (return 0;)

我想实现一个功能,在每次handle_events (),之后轮询每个注册在reactor上的event_loop,请问高人,如何实现。

最新回复

winston at 2008-4-16 17:48:04
没明白你的用意?
bowei_wang at 2008-4-17 07:55:12
就是说要实现如下功能:
while (true)
    {
        int result = this->implementation_->handle_events ();

        ///轮询注册在本reactor中的每一个有效的CEvent_Handler
        for (each CEvent_Handler which is registered in this reactor)
        {
               DoSomething(CEvent_Handler *pEvent_Handler);
        }

        if (eh != 0 && (*eh)(this))
            continue;
        else if (result == -1 && this->implementation_->deactivated ())
            return 0;
        else if (result == -1)
            return -1;
    }