VIDEO: removed dedicated threadpool
parent
662c30ea02
commit
e594749c30
|
@ -6,8 +6,7 @@ namespace video {
|
||||||
|
|
||||||
static const char* supportedFormats[] = { "dae", "fbx", nullptr };
|
static const char* supportedFormats[] = { "dae", "fbx", nullptr };
|
||||||
|
|
||||||
MeshPool::MeshPool() :
|
MeshPool::MeshPool() {
|
||||||
_threadPool(2) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MeshPool::~MeshPool() {
|
MeshPool::~MeshPool() {
|
||||||
|
@ -30,7 +29,7 @@ MeshPtr MeshPool::getMesh(const std::string& id) {
|
||||||
return i->second;
|
return i->second;
|
||||||
|
|
||||||
const MeshPtr mesh(new Mesh());
|
const MeshPtr mesh(new Mesh());
|
||||||
_threadPool.enqueue([=]() {mesh->loadMesh(name);});
|
core::App::getInstance()->threadPool().enqueue([=]() {mesh->loadMesh(name);});
|
||||||
_meshes[name] = mesh;
|
_meshes[name] = mesh;
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Mesh.h"
|
#include "Mesh.h"
|
||||||
#include "core/ThreadPool.h"
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -11,7 +10,6 @@ class MeshPool {
|
||||||
private:
|
private:
|
||||||
typedef std::unordered_map<std::string, MeshPtr> Meshes;
|
typedef std::unordered_map<std::string, MeshPtr> Meshes;
|
||||||
Meshes _meshes;
|
Meshes _meshes;
|
||||||
core::ThreadPool _threadPool;
|
|
||||||
|
|
||||||
std::string getName(const std::string& id) const;
|
std::string getName(const std::string& id) const;
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue