summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp b/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp
index 800174ac1e9..bd208d22b98 100644
--- a/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp
@@ -120,17 +120,20 @@ TAO_EventLogFactory_i::create (
DsLogAdmin::LogFullActionType full_action,
CORBA::ULongLong max_rec_size,
const DsLogAdmin::CapacityAlarmThresholdList & thresholds,
- DsLogAdmin::LogId_out id
+ DsLogAdmin::LogId_out id_out
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
DsLogAdmin::InvalidLogFullAction,
DsLogAdmin::InvalidThreshold))
{
- // Get an id for this Log.
- this->max_id_++;
+ DsLogAdmin::LogId id;
+
+ // Get an unused/unique id for this Log.
+ while (hash_map_.find ((id = this->next_id_++)) == 0)
+ ;
DsEventLogAdmin::EventLog_ptr eventlog =
- this->create_with_id (this->max_id_,
+ this->create_with_id (id,
full_action,
max_rec_size,
thresholds
@@ -138,12 +141,7 @@ TAO_EventLogFactory_i::create (
ACE_CHECK_RETURN (DsEventLogAdmin::EventLog::_nil ());
// Set the id to return..
- id = this->max_id_;
-
- // Store the id in the LogIdList.
- CORBA::ULong len = logid_list_.length();
- logid_list_.length(len+1);
- logid_list_[len] = id;
+ id_out = id;
return eventlog;
}