thread_t cleanup

This commit is contained in:
Nekotekina 2015-08-11 16:26:08 +03:00
parent be9a599beb
commit d9403c2ed2
7 changed files with 40 additions and 94 deletions

View file

@ -248,6 +248,12 @@ namespace vm
return true;
}
waiter_lock_t::waiter_lock_t(thread_t& thread, u32 addr, u32 size)
: m_waiter(_add_waiter(thread, addr, size))
, m_lock(thread.mutex, std::adopt_lock) // must be locked in _add_waiter
{
}
void waiter_lock_t::wait()
{
// if another thread successfully called pred(), it must be set to null