Archived
This forum has been archived. Please start a new discussion on GitHub.
why return false ?
in Help Center
hi, there
why return false at the end of the function?
bool
Glacier2::RequestQueue::addRequest(const RequestPtr& request)
{
IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this);
assert(!_destroy);
for(vector<RequestPtr>::iterator p = _requests.begin(); p != _requests.end(); ++p)
{
//
// If the new request overrides an old one, then abort the old
// request and replace it with the new request.
//
if(request->override(*p))
{
*p = request;
return true;
}
}
//
// No override, we add the new request.
//
_requests.push_back(request);
notify();
return false;
}
why return false at the end of the function?
Cheers
OrNot
why return false at the end of the function?
bool
Glacier2::RequestQueue::addRequest(const RequestPtr& request)
{
IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this);
assert(!_destroy);
for(vector<RequestPtr>::iterator p = _requests.begin(); p != _requests.end(); ++p)
{
//
// If the new request overrides an old one, then abort the old
// request and replace it with the new request.
//
if(request->override(*p))
{
*p = request;
return true;
}
}
//
// No override, we add the new request.
//
_requests.push_back(request);
notify();
return false;
}
why return false at the end of the function?
Cheers
OrNot
0
Comments
-
I'm afraid explaining the internal workings of Glacier2 on the function level is out of the scope of the support we can give here on these forums...0
-
hi, Marc,
Sorry for my carelessness. I read the codes again and understand it now.
Thanks any way.0