Merge pull request #145 from Nekotekina/master

Fixed conflicts.
This commit is contained in:
Alexandro Sánchez Bach 2014-03-31 12:04:34 +02:00
parent 8011cc8ec4
commit 01dbb8eb9a
42 changed files with 1687 additions and 613 deletions

View file

@ -3,7 +3,7 @@
template<typename T, u32 SQSize = 666>
class SQueue
{
SMutex m_mutex;
SMutexGeneral m_mutex;
u32 m_pos;
u32 m_count;
T m_data[SQSize];
@ -15,6 +15,11 @@ public:
{
}
const u32 GetSize() const
{
return SQSize;
}
bool Push(const T& data)
{
while (true)
@ -35,7 +40,7 @@ public:
}
{
SMutexLocker lock(m_mutex);
SMutexGeneralLocker lock(m_mutex);
if (m_count >= SQSize) continue;
@ -66,7 +71,7 @@ public:
}
{
SMutexLocker lock(m_mutex);
SMutexGeneralLocker lock(m_mutex);
if (!m_count) continue;
@ -91,7 +96,7 @@ public:
void Clear()
{
SMutexLocker lock(m_mutex);
SMutexGeneralLocker lock(m_mutex);
m_count = 0;
}
@ -115,7 +120,7 @@ public:
}
{
SMutexLocker lock(m_mutex);
SMutexGeneralLocker lock(m_mutex);
if (m_count) break;
}
}