diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-08-01 23:39:57 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-08-01 23:39:57 +0000 |
commit | 28f2b1eecfab765469d97d38b686bffdea53114c (patch) | |
tree | e11d110b2f6e69f07a780756276cc735be3e8fa9 /TAO/tao/LF_Follower.cpp | |
parent | 545c5cb11c374d0333e7d0f1c88f12694ad2eaee (diff) | |
download | ATCD-28f2b1eecfab765469d97d38b686bffdea53114c.tar.gz |
ChangeLogTag:Wed Aug 1 16:05:36 2001 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'TAO/tao/LF_Follower.cpp')
-rw-r--r-- | TAO/tao/LF_Follower.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/TAO/tao/LF_Follower.cpp b/TAO/tao/LF_Follower.cpp new file mode 100644 index 00000000000..ef5114a42a8 --- /dev/null +++ b/TAO/tao/LF_Follower.cpp @@ -0,0 +1,46 @@ +// -*- C++ -*- +// $Id$ + +#include "tao/LF_Follower.h" +#include "tao/Leader_Follower.h" + +#if !defined (__ACE_INLINE__) +# include "tao/LF_Follower.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(tao, LF_Follower, "$Id$") + +TAO_LF_Follower::TAO_LF_Follower (TAO_Leader_Follower &leader_follower) + : leader_follower_ (leader_follower) + , condition_ (leader_follower.lock ()) +{ +} + +TAO_LF_Follower::~TAO_LF_Follower (void) +{ +} + +int +TAO_LF_Follower::signal (void) +{ + // We *must* remove ourselves from the list of followers, otherwise + // we could get signalled twice: to wake up as a follower and as the + // next leader. + // The follower may not be there if the reply is received while + // the consumer is not yet waiting for it (i.e. it send the + // request but has not blocked to receive the reply yet). + // Ignore errors. + (void) this->leader_follower_.remove_follower (this); + + return this->condition_.signal (); +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + +template class ACE_Intrusive_List_Node<TAO_LF_Follower>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +#pragma instantiate ACE_Intrusive_List_Node<TAO_LF_Follower> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ |