NAME
ACE_Notification_Handler -
Callback and unblock the ACE_Reactor if it's sleeping.
SYNOPSIS
#include <ace/Reactor.h>
class ACE_Notification_Handler : public ACE_Event_Handler
{
public:
int open (ACE_Reactor *);
int close (void);
int handle_notifications (ACE_Handle_Set &rmask);
ssize_t notify (
ACE_Event_Handler * = 0,
ACE_Reactor_Mask = ACE_Event_Handler::EXCEPT_MASK
);
virtual int handle_input (ACE_HANDLE handle);
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
private:
ACE_Reactor *reactor_;
ACE_Pipe notification_pipe_;
};
DESCRIPTION
This implementation is necessary for cases where the Reactor
is being run in a multi-threaded program. In this case, we
need a special trick to unblock select() or poll() when
updates occur in somewhere other than the main ACE_Reactor
thread. All we do is write data to a pipe or socket that the
ACE_Reactor is listening on.
Initialization and termination methods.
int open (ACE_Reactor *);
int close (void);
int handle_notifications (ACE_Handle_Set &rmask);
Handles pending threads (if any) that are waiting to unblock the
Reactor.
ssize_t notify (
ACE_Event_Handler * = 0,
ACE_Reactor_Mask = ACE_Event_Handler::EXCEPT_MASK
);
Called by a thread when it wants to unblock the Reactor.
virtual int handle_input (ACE_HANDLE handle);
Called back by the Reactor when a thread wants to unblock us.
void dump (void) const;
Dump the state of an object.
ACE_ALLOC_HOOK_DECLARE;
Declare the dynamic allocation hooks.
AUTHOR
Doug Schmidt
LIBRARY
ace