cec: don't try to lock the transmit mutex when deleting a command handler
[deb_libcec.git] / src / lib / devices / CECBusDevice.h
index ba686322ca3fe9dab6c87b3817b3afa1f1306477..3de307d9d1381ba3a538d4136cd06450d50c57b2 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the libCEC(R) library.
  *
- * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited.  All rights reserved.
  * libCEC(R) is an original work, containing original code.
  *
  * libCEC(R) is a trademark of Pulse-Eight Limited.
  *     http://www.pulse-eight.net/
  */
 
-#include <cectypes.h>
+#include "../../../include/cectypes.h"
 #include <set>
-#include "../platform/os.h"
+#include "../platform/threads/mutex.h"
+#include "../platform/util/StdString.h"
 
 namespace CEC
 {
@@ -75,6 +76,8 @@ namespace CEC
     virtual bool                  IsActiveSource(void) const { return m_bActiveSource; }
     virtual bool                  IsUnsupportedFeature(cec_opcode opcode) const;
     virtual void                  SetUnsupportedFeature(cec_opcode opcode);
+    virtual void                  HandlePoll(cec_logical_address initiator);
+    virtual bool                  HandleReceiveFailed(void);
 
     virtual void SetInactiveSource(void);
     virtual void SetActiveSource(void);
@@ -106,6 +109,8 @@ namespace CEC
 
   protected:
     bool ReplaceHandler(bool bInitHandler = true);
+    void MarkBusy(void);
+    void MarkReady(void);
 
     bool RequestCecVersion(void);
     bool RequestMenuLanguage(void);
@@ -136,5 +141,8 @@ namespace CEC
     std::set<cec_opcode>  m_unsupportedFeatures;
     PLATFORM::CMutex      m_mutex;
     PLATFORM::CMutex      m_handlerMutex;
+    PLATFORM::CEvent      m_replacing;
+    unsigned              m_iHandlerUseCount;
+    bool                  m_bAwaitingReceiveFailed;
   };
 };