1 #include "ace/Msg_WFMO_Reactor.h"
5 #if defined (ACE_WIN32) && !defined (ACE_LACKS_MSG_WFMO)
7 #if !defined (__ACE_INLINE__)
8 #include "ace/Msg_WFMO_Reactor.inl"
9 #endif /* __ACE_INLINE__ */
11 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
13 ACE_Msg_WFMO_Reactor::ACE_Msg_WFMO_Reactor (ACE_Sig_Handler
*sh
,
15 : ACE_WFMO_Reactor (sh
, tq
)
19 ACE_Msg_WFMO_Reactor::ACE_Msg_WFMO_Reactor (size_t size
,
23 : ACE_WFMO_Reactor (size
, unused
, sh
, tq
)
27 ACE_Msg_WFMO_Reactor::~ACE_Msg_WFMO_Reactor (void)
32 ACE_Msg_WFMO_Reactor::wait_for_multiple_events (int timeout
,
35 // Wait for any of handles_ to be active, or until timeout expires.
36 // If <alertable> is enabled allow asynchronous completion of
37 // ReadFile and WriteFile operations. QS_ALLINPUT allows
38 // <MsgWaitForMultipleObjectsEx> to wait for any message is in the
40 return ::MsgWaitForMultipleObjectsEx (this->handler_rep_
.max_handlep1 (),
41 this->handler_rep_
.handles (),
48 ACE_Msg_WFMO_Reactor::dispatch_window_messages (void)
50 int number_of_messages
= 0;
53 // Process all pending message from this thread's message queue
54 while (::PeekMessage (&msg
, 0, 0, 0, PM_REMOVE
))
56 ::TranslateMessage (&msg
);
57 if (msg
.message
== WM_QUIT
)
59 // Should inform the main thread
60 ::PostQuitMessage (LOWORD (msg
.wParam
));
64 ::DispatchMessage (&msg
);
68 return number_of_messages
;
72 ACE_Msg_WFMO_Reactor::poll_remaining_handles (DWORD slot
)
74 return ::MsgWaitForMultipleObjects (this->handler_rep_
.max_handlep1 () - slot
,
75 this->handler_rep_
.handles () + slot
,
81 ACE_END_VERSIONED_NAMESPACE_DECL
83 #endif /* ACE_WIN32 && !ACE_LACKS_MSG_WFMO */