(file) Return to AutoPThreadSecurity.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2

Diff for /pegasus/src/Pegasus/ProviderManager2/AutoPThreadSecurity.h between version 1.5 and 1.6

version 1.5, 2008/12/02 09:01:48 version 1.6, 2009/03/27 11:52:22
Line 49 
Line 49 
 // of the pthread_security on z/OS // of the pthread_security on z/OS
 // For all other platforms this should be an empty class // For all other platforms this should be an empty class
 // Targets: avoid ifdefs and keep code readable(clean) // Targets: avoid ifdefs and keep code readable(clean)
 #ifndef PEGASUS_ZOS_THREADLEVEL_SECURITY  #ifndef PEGASUS_ZOS_SECURITY
  
 // not z/OS == empty class // not z/OS == empty class
 class AutoPThreadSecurity class AutoPThreadSecurity
 { {
 public: public:
     AutoPThreadSecurity(const OperationContext& context) {};      AutoPThreadSecurity(const OperationContext& context, bool reverse=false) {};
 }; };
  
 #else #else
Line 63 
Line 63 
 class AutoPThreadSecurity class AutoPThreadSecurity
 { {
 public: public:
     AutoPThreadSecurity(const OperationContext& context)      AutoPThreadSecurity(const OperationContext& context, bool reverse=false):
           _reverse(reverse)
       {
           if (!_reverse)
     {     {
         int err_num=enablePThreadSecurity(context);         int err_num=enablePThreadSecurity(context);
         if (err_num!=0)         if (err_num!=0)
         {         {
             // need a new CIMException for this             // need a new CIMException for this
             throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));                  throw CIMException(
                       CIM_ERR_ACCESS_DENIED,
                       String(strerror(err_num)));
               }
           }
           else
           {
               // remember the context, it will be needed in the destructor
               internalOpContextReference = &(context);
               revDisablePThreadSecurity();
         }         }
     };     };
  
     ~AutoPThreadSecurity()     ~AutoPThreadSecurity()
     {     {
           if (!_reverse)
           {
         disablePThreadSecurity();         disablePThreadSecurity();
           }
           else
           {
               revEnablePThreadSecurity(*internalOpContextReference);
           }
     };     };
   private:
       const OperationContext * internalOpContextReference;
       bool _reverse;
 }; };
  
 #endif #endif


Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2