Migration to named_thread<>

Add atomic_t<>::try_dec instead of fetch_dec_sat
Add atomic_t<>::try_inc
GDBDebugServer is broken (needs rewrite)
Removed old_thread class (former named_thread)
Removed storing/rethrowing exceptions from thread
Emu.Stop doesn't inject an exception anymore
task_stack helper class removed
thread_base simplified (no shared_from_this)
thread_ctrl::spawn simplified (creates detached thread)
Implemented overrideable thread detaching logic
Disabled cellAdec, cellDmux, cellFsAio
SPUThread renamed to spu_thread
RawSPUThread removed, spu_thread used instead
Disabled deriving from ppu_thread
Partial support for thread renaming
lv2_timer... simplified, screw it
idm/fxm: butchered support for on_stop/on_init
vm: improved allocation structure (added size)
This commit is contained in:
Nekotekina 2018-10-11 01:17:19 +03:00
parent 8ca6c9fff0
commit 1b37e775be
82 changed files with 1820 additions and 2023 deletions

View file

@ -774,10 +774,8 @@ namespace utils
// If max_count > 1 only id_new is supported
static_assert(std::is_same_v<id_tag, id_new_t> && !std::is_const_v<std::remove_reference_t<Type>>);
// Try to acquire the semaphore (conditional increment)
const uint old_sema = head->m_sema.load();
if (UNLIKELY(old_sema > last || !head->m_sema.compare_and_swap_test(old_sema, old_sema + 1)))
// Try to acquire the semaphore
if (UNLIKELY(!head->m_sema.try_inc(last + 1)))
{
block = nullptr;
}
@ -1225,7 +1223,7 @@ namespace utils
template <typename Type>
std::shared_lock<::notifier> get_free_notifier() const
{
return std::shared_lock{get_head<Type>()->m_free_notifier};
return std::shared_lock(get_head<Type>()->m_free_notifier, std::try_to_lock);
}
};
} // namespace utils