Qt 4.8
Public Functions | Properties | List of all members
QSharedMemoryLocker Class Reference

Helper class. More...

#include <qsharedmemory_p.h>

Public Functions

bool lock ()
 
 QSharedMemoryLocker (QSharedMemory *sharedMemory)
 
 ~QSharedMemoryLocker ()
 

Properties

QSharedMemoryq_sm
 

Detailed Description

Helper class.

Definition at line 87 of file qsharedmemory_p.h.

Constructors and Destructors

◆ QSharedMemoryLocker()

QSharedMemoryLocker::QSharedMemoryLocker ( QSharedMemory sharedMemory)
inline

Definition at line 91 of file qsharedmemory_p.h.

91  : q_sm(sharedMemory)
92  {
93  Q_ASSERT(q_sm);
94  }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QSharedMemory * q_sm

◆ ~QSharedMemoryLocker()

QSharedMemoryLocker::~QSharedMemoryLocker ( )
inline

Definition at line 96 of file qsharedmemory_p.h.

97  {
98  if (q_sm)
99  q_sm->unlock();
100  }
bool unlock()
Releases the lock on the shared memory segment and returns true, if the lock is currently held by thi...
QSharedMemory * q_sm

Functions

◆ lock()

bool QSharedMemoryLocker::lock ( )
inline

Definition at line 102 of file qsharedmemory_p.h.

Referenced by QSharedMemoryPrivate::tryLocker().

103  {
104  if (q_sm && q_sm->lock())
105  return true;
106  q_sm = 0;
107  return false;
108  }
bool lock()
This is a semaphore that locks the shared memory segment for access by this process and returns true...
QSharedMemory * q_sm

Properties

◆ q_sm

QSharedMemory* QSharedMemoryLocker::q_sm
private

Definition at line 111 of file qsharedmemory_p.h.


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