Switching to xe::mutex.

This commit is contained in:
Ben Vanik
2015-05-24 23:16:43 -07:00
parent 814ec82ad4
commit f5a2b85d42
31 changed files with 133 additions and 108 deletions

View File

@@ -13,6 +13,8 @@
#include <mutex>
#include <vector>
#include "xenia/base/mutex.h"
namespace xe {
template <class T, typename A>
@@ -21,7 +23,7 @@ class TypePool {
~TypePool() { Reset(); }
void Reset() {
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<xe::mutex> guard(lock_);
for (auto it = list_.begin(); it != list_.end(); ++it) {
T* value = *it;
delete value;
@@ -32,7 +34,7 @@ class TypePool {
T* Allocate(A arg0) {
T* result = 0;
{
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<xe::mutex> guard(lock_);
if (list_.size()) {
result = list_.back();
list_.pop_back();
@@ -45,12 +47,12 @@ class TypePool {
}
void Release(T* value) {
std::lock_guard<std::mutex> guard(lock_);
std::lock_guard<xe::mutex> guard(lock_);
list_.push_back(value);
}
private:
std::mutex lock_;
xe::mutex lock_;
std::vector<T*> list_;
};