summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/src/IcePack/Activator.cpp6
-rw-r--r--cpp/src/IcePack/LocatorI.cpp2
-rw-r--r--cpp/src/IcePack/ServerAdapterI.cpp35
-rw-r--r--cpp/src/IcePack/WaitQueue.cpp27
4 files changed, 31 insertions, 39 deletions
diff --git a/cpp/src/IcePack/Activator.cpp b/cpp/src/IcePack/Activator.cpp
index 83286edf3b7..c040500d9c7 100644
--- a/cpp/src/IcePack/Activator.cpp
+++ b/cpp/src/IcePack/Activator.cpp
@@ -703,6 +703,12 @@ Activator::activate(const string& name,
{
close(fds[1]);
+ for(i = 0; argv[i]; i++)
+ {
+ free(argv[i]);
+ }
+ free(argv);
+
for(i = 0; i < envCount; ++i)
{
free(envArray[i]);
diff --git a/cpp/src/IcePack/LocatorI.cpp b/cpp/src/IcePack/LocatorI.cpp
index 5f87a60a5af..3568d22a345 100644
--- a/cpp/src/IcePack/LocatorI.cpp
+++ b/cpp/src/IcePack/LocatorI.cpp
@@ -27,7 +27,7 @@ public:
_locator(locator), _id(id), _adapter(adapter)
{
}
-
+
virtual void ice_response(const ::Ice::ObjectPrx& obj)
{
assert(obj);
diff --git a/cpp/src/IcePack/ServerAdapterI.cpp b/cpp/src/IcePack/ServerAdapterI.cpp
index 935ddaa1f03..e205d928d26 100644
--- a/cpp/src/IcePack/ServerAdapterI.cpp
+++ b/cpp/src/IcePack/ServerAdapterI.cpp
@@ -105,6 +105,8 @@ ServerAdapterI::activate_async(const AMD_Adapter_activatePtr& cb, const Ice::Cur
Ice::Trace out(_traceLevels->logger, _traceLevels->adapterCat);
out << "waiting for activation of server adapter `" << id << "'";
}
+
+ _factory->getWaitQueue()->add(new WaitForAdapterActivation(this, _traceLevels, cb), _waitTime);
}
//
@@ -116,16 +118,7 @@ ServerAdapterI::activate_async(const AMD_Adapter_activatePtr& cb, const Ice::Cur
{
if(svr->start(OnDemand))
{
- //
- // Now that the server is activated, wait for the adapter
- // direct proxy to be set.
- //
- Lock sync(*this);
- if(!_proxy)
- {
- _factory->getWaitQueue()->add(new WaitForAdapterActivation(this, _traceLevels, cb), _waitTime);
- return;
- }
+ return;
}
}
catch(const Ice::ObjectNotExistException&)
@@ -136,26 +129,18 @@ ServerAdapterI::activate_async(const AMD_Adapter_activatePtr& cb, const Ice::Cur
// an ObjectNotExist exception.
//
destroy(current);
-
- Ice::ObjectNotExistException ex(__FILE__,__LINE__);
- ex.id = current.id;
- throw ex;
}
//
- // The server couldn't be activated, trace and return the current
- // adapter proxy.
+ // The server couldn't be activated, trace and return the current adapter proxy.
//
+ if(_traceLevels->adapter > 1)
{
- Lock sync(*this);
- if(_traceLevels->adapter > 1)
- {
- Ice::Trace out(_traceLevels->logger, _traceLevels->adapterCat);
- out << "server adapter `" << id << "' activation failed, couldn't start the server";
- }
-
- cb->ice_response(_proxy);
- }
+ Ice::Trace out(_traceLevels->logger, _traceLevels->adapterCat);
+ out << "server adapter `" << id << "' activation failed, couldn't start the server";
+ }
+
+ _factory->getWaitQueue()->notifyAllWaitingOn(this);
}
Ice::ObjectPrx
diff --git a/cpp/src/IcePack/WaitQueue.cpp b/cpp/src/IcePack/WaitQueue.cpp
index 79e143f33cc..3b5883978b5 100644
--- a/cpp/src/IcePack/WaitQueue.cpp
+++ b/cpp/src/IcePack/WaitQueue.cpp
@@ -11,36 +11,37 @@
#include <IcePack/WaitQueue.h>
using namespace std;
+using namespace IcePack;
-IcePack::WaitItem::WaitItem(const Ice::ObjectPtr& object) :
+WaitItem::WaitItem(const Ice::ObjectPtr& object) :
_object(object)
{
}
-IcePack::WaitItem::~WaitItem()
+WaitItem::~WaitItem()
{
}
const IceUtil::Time&
-IcePack::WaitItem:: getExpirationTime()
+WaitItem:: getExpirationTime()
{
return _expiration;
}
void
-IcePack::WaitItem::setExpirationTime(const IceUtil::Time& time)
+WaitItem::setExpirationTime(const IceUtil::Time& time)
{
_expiration = time;
}
-IcePack::WaitQueue::WaitQueue() : _destroyed(false)
+WaitQueue::WaitQueue() : _destroyed(false)
{
}
void
-IcePack::WaitQueue::run()
+WaitQueue::run()
{
- IceUtil::Monitor< IceUtil::Mutex>::Lock sync(*this);
+ Lock sync(*this);
while(true)
{
@@ -124,10 +125,10 @@ IcePack::WaitQueue::run()
}
void
-IcePack::WaitQueue::destroy()
+WaitQueue::destroy()
{
{
- IceUtil::Monitor< IceUtil::Mutex>::Lock sync(*this);
+ Lock sync(*this);
_destroyed = true;
notify();
}
@@ -136,9 +137,9 @@ IcePack::WaitQueue::destroy()
}
void
-IcePack::WaitQueue::add(const WaitItemPtr& item, const IceUtil::Time& wait)
+WaitQueue::add(const WaitItemPtr& item, const IceUtil::Time& wait)
{
- IceUtil::Monitor< IceUtil::Mutex>::Lock sync(*this);
+ Lock sync(*this);
//
// We'll have to notify the thread if it's sleeping for good.
@@ -174,9 +175,9 @@ IcePack::WaitQueue::add(const WaitItemPtr& item, const IceUtil::Time& wait)
}
void
-IcePack::WaitQueue::notifyAllWaitingOn(const Ice::ObjectPtr& object)
+WaitQueue::notifyAllWaitingOn(const Ice::ObjectPtr& object)
{
- IceUtil::Monitor< IceUtil::Mutex>::Lock sync(*this);
+ Lock sync(*this);
//
// TODO: OPTIMIZATION: Use a map with the object as a key.