00001 /* -*- C++ -*- */ 00002 // $Id: TP_Reactor.i,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $ 00003 00004 /************************************************************************/ 00005 // Methods for ACE_EH_Dispatch_Info 00006 /************************************************************************/ 00007 00008 ACE_INLINE void 00009 ACE_EH_Dispatch_Info::reset (void) 00010 { 00011 this->dispatch_ = 0; 00012 00013 this->handle_ = ACE_INVALID_HANDLE; 00014 this->event_handler_ = 0; 00015 this->mask_ = ACE_Event_Handler::NULL_MASK; 00016 this->callback_ = 0; 00017 } 00018 00019 00020 ACE_INLINE 00021 ACE_EH_Dispatch_Info::ACE_EH_Dispatch_Info (void) 00022 { 00023 this->reset (); 00024 } 00025 00026 ACE_INLINE void 00027 ACE_EH_Dispatch_Info::set (ACE_HANDLE handle, 00028 ACE_Event_Handler *event_handler, 00029 ACE_Reactor_Mask mask, 00030 ACE_EH_PTMF callback) 00031 { 00032 this->dispatch_ = 1; 00033 00034 this->handle_ = handle; 00035 this->event_handler_ = event_handler; 00036 this->mask_ = mask; 00037 this->callback_ = callback; 00038 } 00039 00040 ACE_INLINE int 00041 ACE_EH_Dispatch_Info::dispatch (void) const 00042 { 00043 return this->dispatch_; 00044 } 00045 00046 /************************************************************************/ 00047 // Methods for ACE_TP_Token_Guard 00048 /************************************************************************/ 00049 00050 ACE_INLINE 00051 ACE_TP_Token_Guard::ACE_TP_Token_Guard (ACE_Select_Reactor_Token &token) 00052 00053 :token_ (token), 00054 owner_ (0) 00055 { 00056 } 00057 00058 ACE_INLINE 00059 ACE_TP_Token_Guard::~ACE_TP_Token_Guard (void) 00060 { 00061 if (this->owner_ == 1) 00062 { 00063 ACE_MT (this->token_.release ()); 00064 this->owner_ = 0; 00065 } 00066 } 00067 00068 ACE_INLINE void 00069 ACE_TP_Token_Guard::release_token (void) 00070 { 00071 if (this->owner_) 00072 { 00073 ACE_MT (this->token_.release ()); 00074 00075 // We are not the owner anymore.. 00076 this->owner_ = 0; 00077 } 00078 } 00079 00080 ACE_INLINE int 00081 ACE_TP_Token_Guard::is_owner (void) 00082 { 00083 return this->owner_; 00084 } 00085 00086 00087 /************************************************************************/ 00088 // Methods for ACE_TP_Reactor 00089 /************************************************************************/ 00090 ACE_INLINE void 00091 ACE_TP_Reactor::no_op_sleep_hook (void *) 00092 { 00093 } 00094 00095 ACE_INLINE void 00096 ACE_TP_Reactor::clear_handle_read_set (ACE_HANDLE handle) 00097 { 00098 this->ready_set_.wr_mask_.clr_bit (handle); 00099 this->ready_set_.ex_mask_.clr_bit (handle); 00100 this->ready_set_.rd_mask_.clr_bit (handle); 00101 }
1.2.14 written by Dimitri van Heesch,
© 1997-2002