Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1092)

Unified Diff: webrtc/modules/audio_conference_mixer/source/memory_pool_posix.h

Issue 2790533002: Remove ALL usage of CriticalSectionWrapper. (Closed)
Patch Set: remove winXP rw_lock include Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_conference_mixer/source/time_scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_conference_mixer/source/memory_pool_posix.h
diff --git a/webrtc/modules/audio_conference_mixer/source/memory_pool_posix.h b/webrtc/modules/audio_conference_mixer/source/memory_pool_posix.h
index 12aae3f278f072ff08240e565da78aeb753f3b14..8e726f9fcaeea6701e389db6f7227e8c73273d64 100644
--- a/webrtc/modules/audio_conference_mixer/source/memory_pool_posix.h
+++ b/webrtc/modules/audio_conference_mixer/source/memory_pool_posix.h
@@ -14,7 +14,7 @@
#include <assert.h>
#include <list>
-#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
+#include "webrtc/base/criticalsection.h"
#include "webrtc/typedefs.h"
namespace webrtc {
@@ -36,7 +36,7 @@ private:
// Non-atomic function.
int32_t CreateMemory(uint32_t amountToCreate);
- CriticalSectionWrapper* _crit;
+ rtc::CriticalSection _crit;
bool _terminate;
@@ -49,8 +49,7 @@ private:
template<class MemoryType>
MemoryPoolImpl<MemoryType>::MemoryPoolImpl(int32_t initialPoolSize)
- : _crit(CriticalSectionWrapper::CreateCriticalSection()),
- _terminate(false),
+ : _terminate(false),
_initialPoolSize(initialPoolSize),
_createdMemory(0),
_outstandingMemory(0)
@@ -63,13 +62,12 @@ MemoryPoolImpl<MemoryType>::~MemoryPoolImpl()
// Trigger assert if there is outstanding memory.
assert(_createdMemory == 0);
assert(_outstandingMemory == 0);
- delete _crit;
}
template<class MemoryType>
int32_t MemoryPoolImpl<MemoryType>::PopMemory(MemoryType*& memory)
{
- CriticalSectionScoped cs(_crit);
+ rtc::CritScope cs(&_crit);
if(_terminate)
{
memory = NULL;
@@ -97,7 +95,7 @@ int32_t MemoryPoolImpl<MemoryType>::PushMemory(MemoryType*& memory)
{
return -1;
}
- CriticalSectionScoped cs(_crit);
+ rtc::CritScope cs(&_crit);
_outstandingMemory--;
if(_memoryPool.size() > (_initialPoolSize << 1))
{
@@ -115,14 +113,14 @@ int32_t MemoryPoolImpl<MemoryType>::PushMemory(MemoryType*& memory)
template<class MemoryType>
bool MemoryPoolImpl<MemoryType>::Initialize()
{
- CriticalSectionScoped cs(_crit);
+ rtc::CritScope cs(&_crit);
return CreateMemory(_initialPoolSize) == 0;
}
template<class MemoryType>
int32_t MemoryPoolImpl<MemoryType>::Terminate()
{
- CriticalSectionScoped cs(_crit);
+ rtc::CritScope cs(&_crit);
assert(_createdMemory == _outstandingMemory + _memoryPool.size());
_terminate = true;
« no previous file with comments | « no previous file | webrtc/modules/audio_conference_mixer/source/time_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698