summaryrefslogtreecommitdiff
path: root/TAO/tao/LF_CH_Event.cpp
diff options
context:
space:
mode:
authormitza <mitza@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-08-25 23:32:27 +0000
committermitza <mitza@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-08-25 23:32:27 +0000
commit565ba69feea0539949882db12ae17c1240e2562a (patch)
tree7ddda4f7e63a52a891f0130c1222fdf381cd9691 /TAO/tao/LF_CH_Event.cpp
parent9aa4996d644906619fc954de423619060633210e (diff)
downloadATCD-565ba69feea0539949882db12ae17c1240e2562a.tar.gz
ChangeLogTag: Mon Aug 25 22:28:04 UTC 2008 Adam Mitz <mitza@ociweb.com>
Diffstat (limited to 'TAO/tao/LF_CH_Event.cpp')
-rw-r--r--TAO/tao/LF_CH_Event.cpp32
1 files changed, 29 insertions, 3 deletions
diff --git a/TAO/tao/LF_CH_Event.cpp b/TAO/tao/LF_CH_Event.cpp
index 41304c082bc..c093f41eba2 100644
--- a/TAO/tao/LF_CH_Event.cpp
+++ b/TAO/tao/LF_CH_Event.cpp
@@ -1,4 +1,5 @@
#include "tao/LF_CH_Event.h"
+#include "tao/LF_Follower.h"
ACE_RCSID(tao,
LF_Invocation_Event,
@@ -17,13 +18,38 @@ TAO_LF_CH_Event::~TAO_LF_CH_Event (void)
{
}
+int
+TAO_LF_CH_Event::bind (TAO_LF_Follower *follower)
+{
+ return this->followers_.bind (follower, 0);
+}
+
+int
+TAO_LF_CH_Event::unbind (TAO_LF_Follower *follower)
+{
+ return this->followers_.unbind (follower);
+}
+
void
TAO_LF_CH_Event::state_changed_i (int new_state)
{
- if (this->state_ == new_state)
- return;
+ if (this->state_ != new_state)
+ {
+ this->validate_state_change (new_state);
+ }
+
+ ACE_MT (ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->followers_.mutex ()));
+
+ HASH_MAP::iterator end_it = this->followers_.end ();
+ for (HASH_MAP::iterator it = this->followers_.begin (); it != end_it ; ++it)
+ {
+ it->ext_id_->signal ();
+ }
+}
- // Validate the state change
+void
+TAO_LF_CH_Event::validate_state_change (int new_state)
+{
if (this->state_ == TAO_LF_Event::LFS_IDLE)
{
// From the LFS_IDLE state we can only become active.