Allow sys_raw_spu_create_tag to be called more than once

This commit is contained in:
Eladash 2019-12-21 08:16:47 +02:00 committed by Ivan
parent 923cd7ad72
commit 45cff1219c
3 changed files with 9 additions and 9 deletions

View file

@ -936,13 +936,13 @@ void spu_int_ctrl_t::set(u64 ints)
ints &= mask;
// notify if at least 1 bit was set
if (ints && ~stat.fetch_or(ints) & ints && tag)
if (ints && ~stat.fetch_or(ints) & ints && !tag.expired())
{
reader_lock rlock(id_manager::g_mutex);
if (tag)
if (const auto tag_ptr = tag.lock())
{
if (auto handler = tag->handler.lock())
if (auto handler = tag_ptr->handler.lock())
{
handler->exec();
}