Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/Thread.cpp

Issue 29498570: Issue #4711 - remove lagacy Thread and Mutex classes (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created July 26, 2017, 2:39 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/Thread.h ('k') | test/Thread.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/Thread.cpp
diff --git a/src/Thread.cpp b/src/Thread.cpp
index 8e47c4516487c22a70b3d249b14f0af224b21a92..0968de470c9e732a68b6298ab4e2a6aaec5c153b 100644
--- a/src/Thread.cpp
+++ b/src/Thread.cpp
@@ -30,84 +30,4 @@ void AdblockPlus::Sleep(int millis)
#else
usleep(millis * 1000);
#endif
-}
-
-Mutex::Mutex()
-{
-#ifdef WIN32
- InitializeCriticalSection(&nativeMutex);
-#else
- pthread_mutex_init(&nativeMutex, 0);
-#endif
-}
-
-Mutex::~Mutex()
-{
-#ifdef WIN32
- DeleteCriticalSection(&nativeMutex);
-#else
- pthread_mutex_destroy(&nativeMutex);
-#endif
-}
-
-void Mutex::Lock()
-{
-#ifdef WIN32
- EnterCriticalSection(&nativeMutex);
-#else
- pthread_mutex_lock(&nativeMutex);
-#endif
-}
-
-void Mutex::Unlock()
-{
-#ifdef WIN32
- LeaveCriticalSection(&nativeMutex);
-#else
- pthread_mutex_unlock(&nativeMutex);
-#endif
-}
-
-Lock::Lock(Mutex& mutex) : mutex(mutex)
-{
- mutex.Lock();
-}
-
-Lock::~Lock()
-{
- mutex.Unlock();
-}
-
-Thread::Thread(bool deleteSelfOnFinish)
- : m_deleteSelfOnFinish(deleteSelfOnFinish)
-{
-}
-
-Thread::~Thread()
-{
-}
-
-void Thread::Start()
-{
-#ifdef WIN32
- nativeThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&CallRun, this, 0, 0);
-#else
- pthread_create(&nativeThread, 0, (void* (*)(void*)) &CallRun, this);
-#endif
-}
-
-void Thread::Join()
-{
-#ifdef WIN32
- WaitForSingleObject(nativeThread, INFINITE);
-#else
- pthread_join(nativeThread, 0);
-#endif
-}
-
-void Thread::CallRun(Thread* thread)
-{
- thread->Run();
- if (thread->m_deleteSelfOnFinish)
- delete thread;
-}
+}
« no previous file with comments | « src/Thread.h ('k') | test/Thread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld