LF_Follower.cpp

Go to the documentation of this file.
00001 // $Id: LF_Follower.cpp 69150 2005-11-02 07:13:04Z ossama $
00002 
00003 #include "tao/LF_Follower.h"
00004 #include "tao/Leader_Follower.h"
00005 
00006 #if !defined (__ACE_INLINE__)
00007 # include "tao/LF_Follower.inl"
00008 #endif /* __ACE_INLINE__ */
00009 
00010 ACE_RCSID (tao,
00011            LF_Follower,
00012            "$Id: LF_Follower.cpp 69150 2005-11-02 07:13:04Z ossama $")
00013 
00014 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00015 
00016 TAO_LF_Follower::TAO_LF_Follower (TAO_Leader_Follower &leader_follower)
00017   : leader_follower_ (leader_follower)
00018   , condition_ (leader_follower.lock ())
00019 {
00020 }
00021 
00022 TAO_LF_Follower::~TAO_LF_Follower (void)
00023 {
00024 }
00025 
00026 int
00027 TAO_LF_Follower::signal (void)
00028 {
00029   // We *must* remove ourselves from the list of followers, otherwise
00030   // we could get signalled twice: to wake up as a follower and as the
00031   // next leader.
00032   // The follower may not be there if the reply is received while
00033   // the consumer is not yet waiting for it (i.e. it send the
00034   // request but has not blocked to receive the reply yet).
00035   // Ignore errors.
00036   (void) this->leader_follower_.remove_follower (this);
00037 
00038   return this->condition_.signal ();
00039 }
00040 
00041 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Tue Feb 2 17:37:52 2010 for TAO by  doxygen 1.4.7