[prev in list] [next in list] [prev in thread] [next in thread]
List: sptk-commits
Subject: r1632 - trunk/sptk4
From: alexey () mail ! total-knowledge ! com
Date: 2011-09-21 4:09:44
Message-ID: courier.000000004E796388.000075B3 () mail ! total-knowledge ! com
[Download RAW message or body]
Author: alexey
Date: 2011-09-20 21:09:44 -0700 (Tue, 20 Sep 2011)
New Revision: 1632
Modified:
trunk/sptk4/CSafeList.h
Log:
CSafeList: Added missing CODE_GUARD section
Modified: trunk/sptk4/CSafeList.h
===================================================================
--- trunk/sptk4/CSafeList.h 2011-09-21 04:08:46 UTC (rev 1631)
+++ trunk/sptk4/CSafeList.h 2011-09-21 04:09:44 UTC (rev 1632)
@@ -52,7 +52,8 @@
/// item to appear in the list (to be added to the list by another
/// thread).
template <class T>
-class CSafeList {
+class CSafeList
+{
protected:
std::list<T>* m_list; ///< List of the Ts
CCriticalSection m_lock; ///< Lock to protect list operations
@@ -65,7 +66,7 @@
public:
/// @brief Type definition for foreach()
- typedef bool (Method) (T& item,void* parameter);
+ typedef bool (Method) (T& item, void* parameter);
public:
/// @brief Constructor
@@ -176,6 +177,7 @@
/// @return true if all the items were processed
bool foreach(Method* method, void* parameter=NULL)
{
+ CODE_GUARD(m_lock);
iterator itor;
for (itor = m_list->begin(); itor != m_list->end(); itor++) {
if (!method(*itor, parameter))
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic