ThreadBase rewritten (wip)

This commit is contained in:
Nekotekina 2015-07-01 01:25:52 +03:00
parent b7a320fbbd
commit 3aefa2b4e1
85 changed files with 1960 additions and 2183 deletions

View file

@ -119,35 +119,33 @@ void GLFragmentDecompilerThread::Task()
}
GLFragmentProgram::GLFragmentProgram()
: m_decompiler_thread(nullptr)
, id(0)
{
}
GLFragmentProgram::~GLFragmentProgram()
{
if (m_decompiler_thread)
{
Wait();
if (m_decompiler_thread->IsAlive())
{
m_decompiler_thread->Stop();
}
//if (m_decompiler_thread)
//{
// Wait();
// if (m_decompiler_thread->IsAlive())
// {
// m_decompiler_thread->Stop();
// }
delete m_decompiler_thread;
m_decompiler_thread = nullptr;
}
// delete m_decompiler_thread;
// m_decompiler_thread = nullptr;
//}
Delete();
}
void GLFragmentProgram::Wait()
{
if (m_decompiler_thread && m_decompiler_thread->IsAlive())
{
m_decompiler_thread->Join();
}
}
//void GLFragmentProgram::Wait()
//{
// if (m_decompiler_thread && m_decompiler_thread->IsAlive())
// {
// m_decompiler_thread->Join();
// }
//}
void GLFragmentProgram::Decompile(RSXFragmentProgram& prog)
{
@ -163,23 +161,23 @@ void GLFragmentProgram::Decompile(RSXFragmentProgram& prog)
}
}
void GLFragmentProgram::DecompileAsync(RSXFragmentProgram& prog)
{
if (m_decompiler_thread)
{
Wait();
if (m_decompiler_thread->IsAlive())
{
m_decompiler_thread->Stop();
}
delete m_decompiler_thread;
m_decompiler_thread = nullptr;
}
m_decompiler_thread = new GLFragmentDecompilerThread(shader, parr, prog.addr, prog.size, prog.ctrl);
m_decompiler_thread->Start();
}
//void GLFragmentProgram::DecompileAsync(RSXFragmentProgram& prog)
//{
// if (m_decompiler_thread)
// {
// Wait();
// if (m_decompiler_thread->IsAlive())
// {
// m_decompiler_thread->Stop();
// }
//
// delete m_decompiler_thread;
// m_decompiler_thread = nullptr;
// }
//
// m_decompiler_thread = new GLFragmentDecompilerThread(shader, parr, prog.addr, prog.size, prog.ctrl);
// m_decompiler_thread->Start();
//}
void GLFragmentProgram::Compile()
{