libzypp  13.10.6
zypp::ZYppGlobalLock Class Reference

Our broken global lock. More...

Public Member Functions

 ZYppGlobalLock ()
 
 ~ZYppGlobalLock ()
 
pid_t lockerPid () const
 
const std::string & lockerName () const
 
const Pathname & zyppLockFilePath () const
 
bool zyppLocked ()
 Try to aquire a lock. More...
 

Private Types

typedef shared_ptr< void > ScopedGuard
 

Private Member Functions

ScopedGuard accessLockFile ()
 Exception safe access to the lockfile. More...
 
void _openLockFile ()
 Use accessLockFile. More...
 
void _closeLockFile ()
 Use accessLockFile. More...
 
bool isProcessRunning (pid_t pid_r)
 
pid_t readLockFile ()
 
void writeLockFile ()
 

Private Attributes

Pathname _zyppLockFilePath
 
file_lock _zyppLockFileLock
 
FILE * _zyppLockFile
 
pid_t _lockerPid
 
std::string _lockerName
 
bool _cleanLock
 

Detailed Description

Our broken global lock.

Definition at line 91 of file ZYppFactory.cc.

Member Typedef Documentation

Definition at line 140 of file ZYppFactory.cc.

Constructor & Destructor Documentation

zypp::ZYppGlobalLock::ZYppGlobalLock ( )
inline

Definition at line 94 of file ZYppFactory.cc.

zypp::ZYppGlobalLock::~ZYppGlobalLock ( )
inline

Definition at line 103 of file ZYppFactory.cc.

Member Function Documentation

pid_t zypp::ZYppGlobalLock::lockerPid ( ) const
inline

Definition at line 120 of file ZYppFactory.cc.

const std::string& zypp::ZYppGlobalLock::lockerName ( ) const
inline

Definition at line 123 of file ZYppFactory.cc.

const Pathname& zypp::ZYppGlobalLock::zyppLockFilePath ( ) const
inline

Definition at line 126 of file ZYppFactory.cc.

ScopedGuard zypp::ZYppGlobalLock::accessLockFile ( )
inlineprivate

Exception safe access to the lockfile.

* // Exception safe access to the lockfile.
* ScopedGuard closeOnReturn( accessLockFile() );
*

Definition at line 148 of file ZYppFactory.cc.

void zypp::ZYppGlobalLock::_openLockFile ( )
inlineprivate

Use accessLockFile.

Definition at line 156 of file ZYppFactory.cc.

void zypp::ZYppGlobalLock::_closeLockFile ( )
inlineprivate

Use accessLockFile.

Definition at line 170 of file ZYppFactory.cc.

bool zypp::ZYppGlobalLock::isProcessRunning ( pid_t  pid_r)
inlineprivate

Definition at line 188 of file ZYppFactory.cc.

pid_t zypp::ZYppGlobalLock::readLockFile ( )
inlineprivate

Definition at line 215 of file ZYppFactory.cc.

void zypp::ZYppGlobalLock::writeLockFile ( )
inlineprivate

Definition at line 225 of file ZYppFactory.cc.

bool zypp::ZYppGlobalLock::zyppLocked ( )
inline

Try to aquire a lock.

Returns
true if zypp is already locked by another process.

Definition at line 241 of file ZYppFactory.cc.

Member Data Documentation

Pathname zypp::ZYppGlobalLock::_zyppLockFilePath
private

Definition at line 131 of file ZYppFactory.cc.

file_lock zypp::ZYppGlobalLock::_zyppLockFileLock
private

Definition at line 132 of file ZYppFactory.cc.

FILE* zypp::ZYppGlobalLock::_zyppLockFile
private

Definition at line 133 of file ZYppFactory.cc.

pid_t zypp::ZYppGlobalLock::_lockerPid
private

Definition at line 135 of file ZYppFactory.cc.

std::string zypp::ZYppGlobalLock::_lockerName
private

Definition at line 136 of file ZYppFactory.cc.

bool zypp::ZYppGlobalLock::_cleanLock
private

Definition at line 137 of file ZYppFactory.cc.


The documentation for this class was generated from the following file: