summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/SessionI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-05-03 13:12:54 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-05-03 13:12:54 +0000
commit39952a0fc932b6a65612d3402937be9b222c13e1 (patch)
tree451947254047968d700db7286d309401bd3cb09f /cpp/src/IceGrid/SessionI.cpp
parentSome refactoring of string converter usage (diff)
downloadice-39952a0fc932b6a65612d3402937be9b222c13e1.tar.bz2
ice-39952a0fc932b6a65612d3402937be9b222c13e1.tar.xz
ice-39952a0fc932b6a65612d3402937be9b222c13e1.zip
Added stress test, fixed bugs.
Diffstat (limited to 'cpp/src/IceGrid/SessionI.cpp')
-rw-r--r--cpp/src/IceGrid/SessionI.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/cpp/src/IceGrid/SessionI.cpp b/cpp/src/IceGrid/SessionI.cpp
index e4cc9d55913..17576ae0534 100644
--- a/cpp/src/IceGrid/SessionI.cpp
+++ b/cpp/src/IceGrid/SessionI.cpp
@@ -102,6 +102,7 @@ SessionI::SessionI(const string& userId,
_database(database),
_waitQueue(waitQueue),
_destroyed(false),
+ _timestamp(IceUtil::Time::now()),
_allocationTimeout(-1)
{
if(_traceLevels && _traceLevels->session > 0)
@@ -239,11 +240,16 @@ SessionI::getAllocationTimeout() const
return _allocationTimeout;
}
-void
+bool
SessionI::addAllocationRequest(const AllocationRequestPtr& request)
{
Lock sync(*this);
+ if(_destroyed)
+ {
+ return false;
+ }
_requests.insert(request);
+ return true;
}
void
@@ -253,11 +259,16 @@ SessionI::removeAllocationRequest(const AllocationRequestPtr& request)
_requests.erase(request);
}
-void
+bool
SessionI::addAllocation(const AllocatablePtr& allocatable)
{
Lock sync(*this);
+ if(_destroyed)
+ {
+ return false;
+ }
_allocations.insert(allocatable);
+ return true;
}
void