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

Public Functions

QMutexglobalLock ()
 
QMutexinitLock ()
 
QMutexlock (int num)
 
 QOpenSslLocks ()
 
 ~QOpenSslLocks ()
 

Properties

QMutex initLocker
 
QMutex ** locks
 
QMutex locksLocker
 

Detailed Description

Definition at line 109 of file qsslsocket_openssl.cpp.

Constructors and Destructors

◆ QOpenSslLocks()

QOpenSslLocks::QOpenSslLocks ( )
inline

Definition at line 112 of file qsslsocket_openssl.cpp.

115  {
116  QMutexLocker locker(&locksLocker);
117  int numLocks = q_CRYPTO_num_locks();
118  locks = new QMutex *[numLocks];
119  memset(locks, 0, numLocks * sizeof(QMutex *));
120  }
The QMutex class provides access serialization between threads.
Definition: qmutex.h:60
int q_CRYPTO_num_locks()
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
Definition: qmutex.h:101

◆ ~QOpenSslLocks()

QOpenSslLocks::~QOpenSslLocks ( )
inline

Definition at line 121 of file qsslsocket_openssl.cpp.

122  {
123  QMutexLocker locker(&locksLocker);
124  for (int i = 0; i < q_CRYPTO_num_locks(); ++i)
125  delete locks[i];
126  delete [] locks;
127 
129  }
static void deinitialize()
int q_CRYPTO_num_locks()
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
Definition: qmutex.h:101

Functions

◆ globalLock()

QMutex* QOpenSslLocks::globalLock ( )
inline

Definition at line 139 of file qsslsocket_openssl.cpp.

140  {
141  return &locksLocker;
142  }

◆ initLock()

QMutex* QOpenSslLocks::initLock ( )
inline

Definition at line 144 of file qsslsocket_openssl.cpp.

145  {
146  return &initLocker;
147  }

◆ lock()

QMutex* QOpenSslLocks::lock ( int  num)
inline

Definition at line 130 of file qsslsocket_openssl.cpp.

131  {
132  QMutexLocker locker(&locksLocker);
133  QMutex *tmp = locks[num];
134  if (!tmp)
135  tmp = locks[num] = new QMutex(QMutex::Recursive);
136  return tmp;
137  }
The QMutex class provides access serialization between threads.
Definition: qmutex.h:60
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
Definition: qmutex.h:101

Properties

◆ initLocker

QMutex QOpenSslLocks::initLocker
private

Definition at line 150 of file qsslsocket_openssl.cpp.

Referenced by initLock().

◆ locks

QMutex** QOpenSslLocks::locks
private

Definition at line 152 of file qsslsocket_openssl.cpp.

Referenced by lock(), QOpenSslLocks(), and ~QOpenSslLocks().

◆ locksLocker

QMutex QOpenSslLocks::locksLocker
private

Definition at line 151 of file qsslsocket_openssl.cpp.

Referenced by globalLock(), lock(), QOpenSslLocks(), and ~QOpenSslLocks().


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