repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated changelog and bumped version numbers for v1.5.2
[deb_libcec.git]
/
src
/
lib
/
platform
/
util
/
buffer.h
diff --git
a/src/lib/platform/util/buffer.h
b/src/lib/platform/util/buffer.h
index 1c12e86dd05b6ec961f5521f1252ddec0712be58..56ffd6450225384359ce1cb4a159d784d3fb624e 100644
(file)
--- a/
src/lib/platform/util/buffer.h
+++ b/
src/lib/platform/util/buffer.h
@@
-2,7
+2,7
@@
/*
* This file is part of the libCEC(R) library.
*
/*
* 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.
* libCEC(R) is an original work, containing original code.
*
* libCEC(R) is a trademark of Pulse-Eight Limited.
@@
-40,24
+40,32
@@
namespace PLATFORM
struct SyncedBuffer
{
public:
struct SyncedBuffer
{
public:
- SyncedBuffer(size_t iMaxSize = 100)
- {
- m_maxSize = iMaxSize;
- }
+ SyncedBuffer(size_t iMaxSize = 100) :
+ m_maxSize(iMaxSize) {}
virtual ~SyncedBuffer(void)
{
virtual ~SyncedBuffer(void)
{
- CLockObject lock(m_mutex, true);
Clear();
}
void Clear(void)
{
Clear();
}
void Clear(void)
{
+ CLockObject lock(m_mutex);
while (!m_buffer.empty())
m_buffer.pop();
}
while (!m_buffer.empty())
m_buffer.pop();
}
- size_t Size(void) const { return m_buffer.size(); }
+ size_t Size(void)
+ {
+ CLockObject lock(m_mutex);
+ return m_buffer.size();
+ }
+
+ bool IsEmpty(void)
+ {
+ CLockObject lock(m_mutex);
+ return m_buffer.empty();
+ }
bool Push(_BType entry)
{
bool Push(_BType entry)
{