(file) Return to Executor.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/Executor.cpp between version 1.6 and 1.7

version 1.6, 2007/06/12 18:21:00 version 1.7, 2007/06/13 21:21:53
Line 52 
Line 52 
  
 #include <Pegasus/Common/Constants.h> #include <Pegasus/Common/Constants.h>
 #include <Pegasus/Common/Mutex.h> #include <Pegasus/Common/Mutex.h>
   #include <Pegasus/Common/Once.h>
 #include <Pegasus/Common/FileSystem.h> #include <Pegasus/Common/FileSystem.h>
 #include <Pegasus/Common/String.h> #include <Pegasus/Common/String.h>
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
Line 1021 
Line 1022 
  
 static int _executorSock = -1; static int _executorSock = -1;
 static AutoPtr<ExecutorImpl> _executorImpl; static AutoPtr<ExecutorImpl> _executorImpl;
 static Mutex _executorMutex;  static Once _executorImplOnce = PEGASUS_ONCE_INITIALIZER;
  
 static ExecutorImpl* _getImpl()  static void _initExecutorImpl()
 {  
     // Use the double-checked locking technique to avoid the overhead of a lock  
     // on every call.  
   
     if (_executorImpl.get() == 0)  
     {  
         AutoMutex autoMutex(_executorMutex);  
   
         if (_executorImpl.get() == 0)  
         {         {
 #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)
             if (_executorSock == -1)             if (_executorSock == -1)
Line 1043 
Line 1035 
             _executorImpl.reset(new ExecutorLoopbackImpl());             _executorImpl.reset(new ExecutorLoopbackImpl());
 #endif #endif
         }         }
     }  
   
     return _executorImpl.get();  
 }  
  
 void Executor::setSock(int sock) void Executor::setSock(int sock)
 { {
     AutoMutex autoMutex(_executorMutex);  
     _executorSock = sock;     _executorSock = sock;
 } }
  
 int Executor::detectExecutor() int Executor::detectExecutor()
 { {
     return _getImpl()->detectExecutor();      once(&_executorImplOnce, _initExecutorImpl);
       return _executorImpl->detectExecutor();
 } }
  
 int Executor::ping() int Executor::ping()
 { {
     return _getImpl()->ping();      once(&_executorImplOnce, _initExecutorImpl);
       return _executorImpl->ping();
 } }
  
 FILE* Executor::openFile( FILE* Executor::openFile(
     const char* path,     const char* path,
     int mode)     int mode)
 { {
     return _getImpl()->openFile(path, mode);      once(&_executorImplOnce, _initExecutorImpl);
       return _executorImpl->openFile(path, mode);
 } }
  
 int Executor::renameFile( int Executor::renameFile(
     const char* oldPath,     const char* oldPath,
     const char* newPath)     const char* newPath)
 { {
     return _getImpl()->renameFile(oldPath, newPath);      once(&_executorImplOnce, _initExecutorImpl);
       return _executorImpl->renameFile(oldPath, newPath);
 } }
  
 int Executor::removeFile( int Executor::removeFile(
     const char* path)     const char* path)
 { {
     return _getImpl()->removeFile(path);      once(&_executorImplOnce, _initExecutorImpl);
       return _executorImpl->removeFile(path);
 } }
  
 int Executor::startProviderAgent( int Executor::startProviderAgent(
Line 1092 
Line 1084 
     AnonymousPipe*& readPipe,     AnonymousPipe*& readPipe,
     AnonymousPipe*& writePipe)     AnonymousPipe*& writePipe)
 { {
     return _getImpl()->startProviderAgent(      once(&_executorImplOnce, _initExecutorImpl);
       return _executorImpl->startProviderAgent(
         module, pegasusHome, userName, pid, readPipe, writePipe);         module, pegasusHome, userName, pid, readPipe, writePipe);
 } }
  
 int Executor::daemonizeExecutor() int Executor::daemonizeExecutor()
 { {
     return _getImpl()->daemonizeExecutor();      once(&_executorImplOnce, _initExecutorImpl);
       return _executorImpl->daemonizeExecutor();
 } }
  
 int Executor::reapProviderAgent( int Executor::reapProviderAgent(
     int pid)     int pid)
 { {
     return _getImpl()->reapProviderAgent(pid);      once(&_executorImplOnce, _initExecutorImpl);
       return _executorImpl->reapProviderAgent(pid);
 } }
  
 int Executor::authenticatePassword( int Executor::authenticatePassword(
     const char* username,     const char* username,
     const char* password)     const char* password)
 { {
     return _getImpl()->authenticatePassword(username, password);      once(&_executorImplOnce, _initExecutorImpl);
       return _executorImpl->authenticatePassword(username, password);
 } }
  
 int Executor::validateUser( int Executor::validateUser(
     const char* username)     const char* username)
 { {
     return _getImpl()->validateUser(username);      once(&_executorImplOnce, _initExecutorImpl);
       return _executorImpl->validateUser(username);
 } }
  
 int Executor::challengeLocal( int Executor::challengeLocal(
     const char* user,     const char* user,
     char challengeFilePath[EXECUTOR_BUFFER_SIZE])     char challengeFilePath[EXECUTOR_BUFFER_SIZE])
 { {
     return _getImpl()->challengeLocal(user, challengeFilePath);      once(&_executorImplOnce, _initExecutorImpl);
       return _executorImpl->challengeLocal(user, challengeFilePath);
 } }
  
 int Executor::authenticateLocal( int Executor::authenticateLocal(
     const char* challengeFilePath,     const char* challengeFilePath,
     const char* response)     const char* response)
 { {
     return _getImpl()->authenticateLocal(challengeFilePath, response);      once(&_executorImplOnce, _initExecutorImpl);
       return _executorImpl->authenticateLocal(challengeFilePath, response);
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2