From: Lars Op den Kamp Date: Wed, 15 Feb 2012 10:00:33 +0000 (+0100) Subject: cec: don't reset the "adapter message sent" event X-Git-Tag: upstream/2.2.0~1^2~35^2~48 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=de49d80bb32eef6589d7d3a2413aa684a39b7e34;p=deb_libcec.git cec: don't reset the "adapter message sent" event --- diff --git a/src/lib/adapter/USBCECAdapterMessage.h b/src/lib/adapter/USBCECAdapterMessage.h index d3f5d3e..06e4088 100644 --- a/src/lib/adapter/USBCECAdapterMessage.h +++ b/src/lib/adapter/USBCECAdapterMessage.h @@ -38,7 +38,8 @@ namespace CEC class CCECAdapterMessage { public: - CCECAdapterMessage(void) + CCECAdapterMessage(void) : + event(false) { Clear(); } diff --git a/src/lib/platform/threads/mutex.h b/src/lib/platform/threads/mutex.h index 4a0c331..5a9ae13 100644 --- a/src/lib/platform/threads/mutex.h +++ b/src/lib/platform/threads/mutex.h @@ -280,10 +280,11 @@ namespace PLATFORM class CEvent { public: - CEvent(void) : + CEvent(bool bAutoReset = true) : m_bSignaled(false), m_bBroadcast(false), - m_iWaitingThreads(0) {} + m_iWaitingThreads(0), + m_bAutoReset(bAutoReset) {} virtual ~CEvent(void) {} void Broadcast(void) @@ -336,7 +337,7 @@ namespace PLATFORM { CLockObject lock(m_mutex); bool bReturn(m_bSignaled); - if (bReturn && (--m_iWaitingThreads == 0 || !m_bBroadcast)) + if (bReturn && (--m_iWaitingThreads == 0 || !m_bBroadcast) && m_bAutoReset) m_bSignaled = false; return bReturn; } @@ -346,5 +347,6 @@ namespace PLATFORM CMutex m_mutex; volatile bool m_bBroadcast; unsigned int m_iWaitingThreads; + bool m_bAutoReset; }; }