Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / CSD_ThreadPool / CSD_TP_Cancel_Visitor.cpp
blob259cdff76a3befc600952408f419e8dd3d698e3f
1 #include "tao/CSD_ThreadPool/CSD_TP_Cancel_Visitor.h"
2 #include "tao/CSD_ThreadPool/CSD_TP_Request.h"
4 #if !defined (__ACE_INLINE__)
5 # include "tao/CSD_ThreadPool/CSD_TP_Cancel_Visitor.inl"
6 #endif /* ! __ACE_INLINE__ */
9 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
11 TAO::CSD::TP_Cancel_Visitor::~TP_Cancel_Visitor()
16 bool
17 TAO::CSD::TP_Cancel_Visitor::visit_request(TP_Request* request,
18 bool& remove_flag)
20 // If our servant_ data member is in the 'nil' state, then
21 // we are supposed to cancel *ALL* requests that we visit.
23 // Otherwise, if our servant_ data member is not in the 'nil' state,
24 // we are supposed to cancel only requests that target our specific
25 // servant_.
27 if ((this->servant_.in() == 0) || (request->is_target(this->servant_.in())))
29 // Set the remove_flag to true so that this request is removed
30 // (and released) from the queue when we finish our visit.
31 remove_flag = true;
33 // Cancel the request
34 request->cancel();
37 // Since we are either cancelling requests to any servant or a
38 // specific servant, always continue visitation.
39 return true;
42 TAO_END_VERSIONED_NAMESPACE_DECL