mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
cellAudio, thread_t improvements, pause/resume callback
This commit is contained in:
parent
4dae27c1d4
commit
b897a5d20a
10 changed files with 478 additions and 259 deletions
|
@ -537,16 +537,32 @@ bool ThreadBase::TestDestroy() const
|
|||
return m_destroy;
|
||||
}
|
||||
|
||||
thread_t::thread_t(const std::string& name, std::function<void()> func) : m_name(name), m_state(TS_NON_EXISTENT)
|
||||
thread_t::thread_t(const std::string& name, bool autojoin, std::function<void()> func)
|
||||
: m_name(name)
|
||||
, m_state(TS_NON_EXISTENT)
|
||||
, m_autojoin(autojoin)
|
||||
{
|
||||
start(func);
|
||||
}
|
||||
|
||||
thread_t::thread_t(const std::string& name) : m_name(name), m_state(TS_NON_EXISTENT)
|
||||
thread_t::thread_t(const std::string& name, std::function<void()> func)
|
||||
: m_name(name)
|
||||
, m_state(TS_NON_EXISTENT)
|
||||
, m_autojoin(false)
|
||||
{
|
||||
start(func);
|
||||
}
|
||||
|
||||
thread_t::thread_t(const std::string& name)
|
||||
: m_name(name)
|
||||
, m_state(TS_NON_EXISTENT)
|
||||
, m_autojoin(false)
|
||||
{
|
||||
}
|
||||
|
||||
thread_t::thread_t() : m_state(TS_NON_EXISTENT)
|
||||
thread_t::thread_t()
|
||||
: m_state(TS_NON_EXISTENT)
|
||||
, m_autojoin(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -559,7 +575,14 @@ thread_t::~thread_t()
|
|||
{
|
||||
if (m_state == TS_JOINABLE)
|
||||
{
|
||||
m_thr.detach();
|
||||
if (m_autojoin)
|
||||
{
|
||||
m_thr.join();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_thr.detach();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -717,6 +740,9 @@ void waiter_map_t::notify(u64 signal_id)
|
|||
}
|
||||
}
|
||||
|
||||
static const std::function<bool()> SQUEUE_ALWAYS_EXIT = [](){ return true; };
|
||||
static const std::function<bool()> SQUEUE_NEVER_EXIT = [](){ return false; };
|
||||
|
||||
bool squeue_test_exit()
|
||||
{
|
||||
return Emu.IsStopped();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue