doc ru, printf() before assert in containers
This commit is contained in:
@@ -34,25 +34,25 @@ class PIP_EXPORT PIMutex
|
||||
public:
|
||||
NO_COPY_CLASS(PIMutex)
|
||||
|
||||
//! Constructs unlocked mutex
|
||||
//! \~english Constructs unlocked mutex
|
||||
//! \~russian Создает незаблокированный мьютекс
|
||||
explicit PIMutex();
|
||||
|
||||
//! Destroy mutex
|
||||
//! \~english Destroy mutex
|
||||
//! \~russian Деструктор мьютекса
|
||||
~PIMutex();
|
||||
|
||||
|
||||
//! \brief Lock mutex
|
||||
//! \details If mutex is unlocked it set to locked state and returns immediate.
|
||||
//! If mutex is already locked function blocks until mutex will be unlocked
|
||||
//! \~english Lock mutex
|
||||
//! \~russian Блокирует мьютекс
|
||||
void lock();
|
||||
|
||||
//! \brief Unlock mutex
|
||||
//! \details In any case this function returns immediate
|
||||
void unlock() ;
|
||||
//! \~english Unlock mutex
|
||||
//! \~russian Разблокирует мьютекс
|
||||
void unlock();
|
||||
|
||||
//! \brief Try to lock mutex
|
||||
//! \details If mutex is unlocked it set to locked state and returns "true" immediate.
|
||||
//! If mutex is already locked function returns immediate an returns "false"
|
||||
//! \~english Try to lock mutex
|
||||
//! \~russian Пробует заблокировать мьютекс
|
||||
bool tryLock();
|
||||
|
||||
void * handle();
|
||||
@@ -66,22 +66,24 @@ private:
|
||||
};
|
||||
|
||||
|
||||
//! \brief PIMutexLocker
|
||||
//! \details Same as std::lock_guard<std::mutex>.
|
||||
//! When a PIMutexLocker object is created, it attempts to lock the mutex it is given, if "condition" true.
|
||||
//! When control leaves the scope in which the PIMutexLocker object was created,
|
||||
//! the PIMutexLocker is destructed and the mutex is released, if "condition" true.
|
||||
//! If "condition" false this class do nothing.
|
||||
//! The PIMutexLocker class is non-copyable.
|
||||
class PIP_EXPORT PIMutexLocker
|
||||
{
|
||||
public:
|
||||
NO_COPY_CLASS(PIMutexLocker)
|
||||
|
||||
//! \~english Constructs and lock "m" if "condition" is \c true
|
||||
//! \~russian
|
||||
PIMutexLocker(PIMutex & m, bool condition = true): mutex(m), cond(condition) {if (cond) mutex.lock();}
|
||||
|
||||
//! \~english Unlock "m" if "condition" was \c true
|
||||
//! \~russian
|
||||
~PIMutexLocker() {if (cond) mutex.unlock();}
|
||||
|
||||
private:
|
||||
PIMutex & mutex;
|
||||
bool cond;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // PIMUTEX_H
|
||||
|
||||
Reference in New Issue
Block a user