Optimizations (#1680)

* Optimizations

1) Some headers simplified for better compilation time
2) Some templates simplified for smaller executable size
3) Eliminate std::future to fix compilation for mingw64
4) PKG installation can be cancelled now
5) cellGame fixes
6) XAudio2 fix for mingw64
7) PPUInterpreter bug fixed (Clang)

* any_pod<> implemented

Aliases: any16, any32, any64
rsx::make_command fixed
This commit is contained in:
Ivan 2016-04-25 13:49:12 +03:00
parent 75fe95eeb1
commit da7472fe81
96 changed files with 2086 additions and 1772 deletions

View file

@ -560,43 +560,44 @@ namespace rsx
}
else
{
std::lock_guard<std::mutex> lock{ m_mtx_task };
Expects(0);
//std::lock_guard<std::mutex> lock{ m_mtx_task };
internal_task_entry &front = m_internal_tasks.front();
//internal_task_entry &front = m_internal_tasks.front();
if (front.callback())
{
front.promise.set_value();
m_internal_tasks.pop_front();
}
//if (front.callback())
//{
// front.promise.set_value();
// m_internal_tasks.pop_front();
//}
}
}
std::future<void> thread::add_internal_task(std::function<bool()> callback)
{
std::lock_guard<std::mutex> lock{ m_mtx_task };
m_internal_tasks.emplace_back(callback);
//std::future<void> thread::add_internal_task(std::function<bool()> callback)
//{
// std::lock_guard<std::mutex> lock{ m_mtx_task };
// m_internal_tasks.emplace_back(callback);
return m_internal_tasks.back().promise.get_future();
}
// return m_internal_tasks.back().promise.get_future();
//}
void thread::invoke(std::function<bool()> callback)
{
if (get_thread_ctrl() == thread_ctrl::get_current())
{
while (true)
{
if (callback())
{
break;
}
}
}
else
{
add_internal_task(callback).wait();
}
}
//void thread::invoke(std::function<bool()> callback)
//{
// if (operator->() == thread_ctrl::get_current())
// {
// while (true)
// {
// if (callback())
// {
// break;
// }
// }
// }
// else
// {
// add_internal_task(callback).wait();
// }
//}
namespace
{