mirror of
https://gitlab.xiph.org/xiph/icecast-common.git
synced 2024-12-04 14:46:31 -05:00
Fix: Fixed deadlock on igloo_ro_get_instance()
This commit is contained in:
parent
b7aa541794
commit
3b68465b67
5
src/ro.c
5
src/ro.c
@ -351,14 +351,17 @@ igloo_ro_t igloo_ro_get_instance(igloo_ro_t self)
|
|||||||
} else {
|
} else {
|
||||||
ret = base->instance;
|
ret = base->instance;
|
||||||
}
|
}
|
||||||
|
igloo_thread_mutex_unlock(&(base->lock));
|
||||||
|
|
||||||
|
/* We do this after unlock to avoid dead locks.
|
||||||
|
* This is valid as we have at least a weak ref to the target
|
||||||
|
*/
|
||||||
if (!igloo_RO_IS_NULL(ret)) {
|
if (!igloo_RO_IS_NULL(ret)) {
|
||||||
if (igloo_ro_ref(ret) != igloo_ERROR_NONE) {
|
if (igloo_ro_ref(ret) != igloo_ERROR_NONE) {
|
||||||
igloo_thread_mutex_unlock(&(base->lock));
|
igloo_thread_mutex_unlock(&(base->lock));
|
||||||
return igloo_RO_NULL;
|
return igloo_RO_NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
igloo_thread_mutex_unlock(&(base->lock));
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user