Index: src/Thread.h |
=================================================================== |
--- a/src/Thread.h |
+++ b/src/Thread.h |
@@ -9,40 +9,40 @@ |
namespace AdblockPlus |
{ |
+ class Mutex |
+ { |
+ public: |
+#ifdef WIN32 |
+ CRITICAL_SECTION nativeMutex; |
+#else |
+ pthread_mutex_t nativeMutex; |
+#endif |
+ |
+ Mutex(); |
+ ~Mutex(); |
+ void Lock(); |
+ void Unlock(); |
+ }; |
+ |
+ class ConditionVariable |
+ { |
+ public: |
+ ConditionVariable(); |
+ ~ConditionVariable(); |
+ void Wait(Mutex& mutex); |
+ void Signal(); |
+ |
+ private: |
+#ifdef WIN32 |
+ CONDITION_VARIABLE nativeCondition; |
+#else |
+ pthread_cond_t nativeCondition; |
+#endif |
+ }; |
+ |
class Thread |
{ |
public: |
- class Mutex |
- { |
- public: |
-#ifdef WIN32 |
- CRITICAL_SECTION nativeMutex; |
-#else |
- pthread_mutex_t nativeMutex; |
-#endif |
- |
- Mutex(); |
- ~Mutex(); |
- void Lock(); |
- void Unlock(); |
- }; |
- |
- class Condition |
- { |
- public: |
- Condition(); |
- ~Condition(); |
- void Wait(Mutex& mutex); |
- void Signal(); |
- |
- private: |
-#ifdef WIN32 |
- CONDITION_VARIABLE nativeCondition; |
-#else |
- pthread_cond_t nativeCondition; |
-#endif |
- }; |
- |
virtual ~Thread(); |
virtual void Run() = 0; |
void Start(); |
@@ -50,9 +50,9 @@ |
private: |
#ifdef WIN32 |
- HANDLE thread; |
+ HANDLE nativeThread; |
#else |
- pthread_t thread; |
+ pthread_t nativeThread; |
#endif |
}; |
} |