From: Lars Op den Kamp Date: Tue, 27 Dec 2011 19:13:41 +0000 (+0100) Subject: cec: add a bRecursive parameter to the constructor of CMutex X-Git-Tag: upstream/2.2.0~1^2~43^2~14 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f52ac1fb1e50faf6183ddabdd35bdeb9d66d4e8a;p=deb_libcec.git cec: add a bRecursive parameter to the constructor of CMutex --- diff --git a/src/lib/platform/threads.cpp b/src/lib/platform/threads.cpp index 9ea0008..d168e90 100644 --- a/src/lib/platform/threads.cpp +++ b/src/lib/platform/threads.cpp @@ -35,9 +35,9 @@ using namespace CEC; -CMutex::CMutex(void) +CMutex::CMutex(bool bRecursive /* = true */) { - pthread_mutex_init(&m_mutex, GetMutexAttribute()); + pthread_mutex_init(&m_mutex, bRecursive ? GetMutexAttribute() : NULL); } CMutex::~CMutex(void) diff --git a/src/lib/platform/threads.h b/src/lib/platform/threads.h index 6b0b870..a258081 100644 --- a/src/lib/platform/threads.h +++ b/src/lib/platform/threads.h @@ -56,7 +56,7 @@ namespace CEC class CMutex { public: - CMutex(void); + CMutex(bool bRecursive = true); virtual ~CMutex(void); bool TryLock(void);