diff options
author | alex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-05-23 16:34:11 +0000 |
---|---|---|
committer | alex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-05-23 16:34:11 +0000 |
commit | 5a7724c9534fdf46409f6c1edf8bb0b8408d6385 (patch) | |
tree | 0ad7c4784ff6671e0f16b19e1b899b950c03656c /ace/POSIX_Proactor.cpp | |
parent | 35051f07c407b4e462960a0c86b97605f0ac3bbb (diff) | |
download | ATCD-5a7724c9534fdf46409f6c1edf8bb0b8408d6385.tar.gz |
ChangeLog Entry: Sun May 23 11:33:07 1999 Alexander Babu Arulanthu <alex@cs.wustl.edu>
Diffstat (limited to 'ace/POSIX_Proactor.cpp')
-rw-r--r-- | ace/POSIX_Proactor.cpp | 80 |
1 files changed, 77 insertions, 3 deletions
diff --git a/ace/POSIX_Proactor.cpp b/ace/POSIX_Proactor.cpp index bf84e9ebff2..68c8aaf7be0 100644 --- a/ace/POSIX_Proactor.cpp +++ b/ace/POSIX_Proactor.cpp @@ -13,6 +13,38 @@ #include "ace/POSIX_Proactor.i" #endif /* __ACE_INLINE__ */ +class ACE_Export ACE_POSIX_Wakeup_Completion : public ACE_POSIX_Asynch_Result +{ + // = TITLE + // + // This is result object is used by the <end_event_loop> of the + // ACE_Proactor interface to wake up all the threads blocking + // for completions. + // + // = DESCRIPTION + // + +public: + ACE_POSIX_Wakeup_Completion (ACE_Handler &handler, + const void *act = 0, + ACE_HANDLE event = ACE_INVALID_HANDLE, + int priority = 0, + int signal_number = ACE_SIGRTMIN); + // Constructor. + + virtual ~ACE_POSIX_Wakeup_Completion (void); + // Destructor. + + + virtual void complete (u_long bytes_transferred = 0, + int success = 1, + const void *completion_key = 0, + u_long error = 0); + // This method calls the <handler>'s <handle_wakeup> method. +}; + +// ********************************************************************* + ACE_POSIX_Proactor::~ACE_POSIX_Proactor (void) { this->close (); @@ -308,6 +340,23 @@ ACE_POSIX_Proactor::application_specific_code (ACE_POSIX_Asynch_Result *asynch_r } } +int +ACE_POSIX_Proactor::post_wakeup_completions (int how_many) +{ + ACE_POSIX_Wakeup_Completion *wakeup_completion = 0; + for (ssize_t ci = 0; ci < how_many; ci++) + { + ACE_NEW_RETURN (wakeup_completion, + ACE_POSIX_Wakeup_Completion (this->wakeup_handler_), + -1); + + if (wakeup_completion->post_completion (this) == -1) + return -1; + } + + return 0; +} + // ********************************************************************* class ACE_Export ACE_AIOCB_Notify_Pipe_Manager : public ACE_Handler @@ -982,9 +1031,9 @@ ACE_POSIX_SIG_Proactor::null_handler (int signal_number, void * /* context */) { ACE_ERROR ((LM_ERROR, - "Error:(%P | %t):%s:Signal number %d\n" - "Mask all the RT signals for this thread", - "ACE_POSIX_SIG_Proactor::null_handler called", + "Error:(%P | %t):ACE_POSIX_SIG_Proactor::null_handler called," + "Signal number %d," + "Mask all the RT signals for this thread\n", signal_number)); } @@ -1156,4 +1205,29 @@ ACE_POSIX_Asynch_Timer::complete (u_long bytes_transferred, this->handler_.handle_time_out (this->time_, this->act ()); } +// ********************************************************************* + +ACE_POSIX_Wakeup_Completion::ACE_POSIX_Wakeup_Completion (ACE_Handler &handler, + const void *act, + ACE_HANDLE event, + int priority, + int signal_number) + : ACE_Asynch_Result_Impl (), + ACE_POSIX_Asynch_Result (handler, act, event, 0, 0, priority, signal_number) +{ +} + +ACE_POSIX_Wakeup_Completion::~ACE_POSIX_Wakeup_Completion (void) +{ +} + +void +ACE_POSIX_Wakeup_Completion::complete (u_long /* bytes_transferred */, + int /* success */, + const void * /* completion_key */, + u_long /* error */) +{ + this->handler_.handle_wakeup (); +} + #endif /* ACE_HAS_AIO_CALLS */ |