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; |