Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Msg_WFMO_Reactor.cpp
blobaf05fb8929ca91997b3e272d793050c4fdd8c3e8
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,
12 ACE_Timer_Queue *tq)
13 : ACE_WFMO_Reactor (sh, tq)
17 ACE_Msg_WFMO_Reactor::ACE_Msg_WFMO_Reactor (size_t size,
18 int unused,
19 ACE_Sig_Handler *sh,
20 ACE_Timer_Queue *tq)
21 : ACE_WFMO_Reactor (size, unused, sh, tq)
25 ACE_Msg_WFMO_Reactor::~ACE_Msg_WFMO_Reactor ()
29 DWORD
30 ACE_Msg_WFMO_Reactor::wait_for_multiple_events (int timeout,
31 int alertable)
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
37 // queue.
38 return ::MsgWaitForMultipleObjectsEx (this->handler_rep_.max_handlep1 (),
39 this->handler_rep_.handles (),
40 timeout,
41 QS_ALLINPUT,
42 alertable);
45 int
46 ACE_Msg_WFMO_Reactor::dispatch_window_messages ()
48 int number_of_messages = 0;
49 MSG msg;
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));
59 return -1;
62 ::DispatchMessage (&msg);
63 ++number_of_messages;
66 return number_of_messages;
69 DWORD
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,
74 FALSE,
76 QS_ALLINPUT);
79 ACE_END_VERSIONED_NAMESPACE_DECL
81 #endif /* ACE_WIN32 */