1 #include "ace/Msg_WFMO_Reactor.h"
3 #if defined (ACE_WIN32)
5 #if !defined (__ACE_INLINE__)
6 #include "ace/Msg_WFMO_Reactor.inl"
7 #endif /* __ACE_INLINE__ */
9 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
11 ACE_Msg_WFMO_Reactor::ACE_Msg_WFMO_Reactor (ACE_Sig_Handler
*sh
,
13 : ACE_WFMO_Reactor (sh
, tq
)
17 ACE_Msg_WFMO_Reactor::ACE_Msg_WFMO_Reactor (size_t size
,
21 : ACE_WFMO_Reactor (size
, unused
, sh
, tq
)
25 ACE_Msg_WFMO_Reactor::~ACE_Msg_WFMO_Reactor ()
30 ACE_Msg_WFMO_Reactor::wait_for_multiple_events (int timeout
,
33 // Wait for any of handles_ to be active, or until timeout expires.
34 // If <alertable> is enabled allow asynchronous completion of
35 // ReadFile and WriteFile operations. QS_ALLINPUT allows
36 // <MsgWaitForMultipleObjectsEx> to wait for any message is in the
38 return ::MsgWaitForMultipleObjectsEx (this->handler_rep_
.max_handlep1 (),
39 this->handler_rep_
.handles (),
46 ACE_Msg_WFMO_Reactor::dispatch_window_messages ()
48 int number_of_messages
= 0;
51 // Process all pending message from this thread's message queue
52 while (::PeekMessage (&msg
, 0, 0, 0, PM_REMOVE
))
54 ::TranslateMessage (&msg
);
55 if (msg
.message
== WM_QUIT
)
57 // Should inform the main thread
58 ::PostQuitMessage (LOWORD (msg
.wParam
));
62 ::DispatchMessage (&msg
);
66 return number_of_messages
;
70 ACE_Msg_WFMO_Reactor::poll_remaining_handles (DWORD slot
)
72 return ::MsgWaitForMultipleObjects (this->handler_rep_
.max_handlep1 () - slot
,
73 this->handler_rep_
.handles () + slot
,
79 ACE_END_VERSIONED_NAMESPACE_DECL
81 #endif /* ACE_WIN32 */