summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2006-03-28 22:20:18 +0000
committerHenri Herscher <henri@oreka.org>2006-03-28 22:20:18 +0000
commit0feb343edd90b64b15c6ecc2fe24e476843b5cff (patch)
tree62929ca337a5e098ec2e9b93a37015431e3fd878
parent29e915ae14b608e59bec6113b6e791cfa3fef76e (diff)
Removed timeout on semaphore acquire on linux. This was causing permanent 100% CPU.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@204 09dcff7a-b715-0410-9601-b79a96267cd0
-rw-r--r--orkaudio/ThreadSafeQueue.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/orkaudio/ThreadSafeQueue.h b/orkaudio/ThreadSafeQueue.h
index c14b5b9..4fd0cda 100644
--- a/orkaudio/ThreadSafeQueue.h
+++ b/orkaudio/ThreadSafeQueue.h
@@ -64,8 +64,13 @@ template <class T> bool ThreadSafeQueue<T>::push(T &element)
/** Pop and element from the queue, or blocks until one available */
template <class T> T ThreadSafeQueue<T>::pop()
{
+// #### Fixme: when timeout specified under Linux CentOS 4.2, acquire returns immediately instead of waiting for the timeout -> causes CPU to spike at 100%
+#ifdef WIN32
ACE_Time_Value timeout(time(NULL)+2);
m_semaphore.acquire(&timeout);
+#else
+ m_semaphore.acquire();
+#endif
MutexSentinel mutexSentinel(m_mutex);
T element;