UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
UPnPsdk::CPthread_scoped_lock Class Reference

Scoped POSIX thread mutex lock is valid for the current scope of the object. More...

#include <pthread.hpp>

Public Member Functions

 CPthread_scoped_lock (::pthread_mutex_t &a_mutex)
 Locks given POSIX thread mutex.
 
 ~CPthread_scoped_lock ()
 Unlock the mutex that was locked by the constructor.
 

Detailed Description

Scoped POSIX thread mutex lock is valid for the current scope of the object.

The constructor locks the given mutex and the destructor unlocks it. This way the locked mutex is authomatically unlocked when leaving the current scope, for example on return or with an exception.

Exceptions
std::runtime_errorThe mutex has not been properly initialized.

Definition at line 103 of file pthread.hpp.

Constructor & Destructor Documentation

◆ CPthread_scoped_lock()

UPnPsdk::CPthread_scoped_lock::CPthread_scoped_lock ( ::pthread_mutex_t &  a_mutex)

Locks given POSIX thread mutex.

Parameters
[in]a_mutexMutex used to lock.

Definition at line 29 of file pthread.cpp.

◆ ~CPthread_scoped_lock()

UPnPsdk::CPthread_scoped_lock::~CPthread_scoped_lock ( )

Unlock the mutex that was locked by the constructor.

Definition at line 37 of file pthread.cpp.


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