| 221 | } |
| 222 | |
| 223 | static void pool_return_entry(void *ref_) |
| 224 | { |
| 225 | RefCount *ref = ref_; |
| 226 | AVRefStructPool *pool = ref->opaque.nc; |
| 227 | |
| 228 | ff_mutex_lock(&pool->mutex); |
| 229 | if (!pool->uninited) { |
| 230 | ref->opaque.nc = pool->available_entries; |
| 231 | pool->available_entries = ref; |
| 232 | ref = NULL; |
| 233 | } |
| 234 | ff_mutex_unlock(&pool->mutex); |
| 235 | |
| 236 | if (ref) |
| 237 | pool_free_entry(pool, ref); |
| 238 | |
| 239 | if (atomic_fetch_sub_explicit(&pool->refcount, 1, memory_order_acq_rel) == 1) |
| 240 | pool_free(pool); |
| 241 | } |
| 242 | |
| 243 | static void pool_reset_entry(AVRefStructOpaque opaque, void *entry) |
| 244 | { |
nothing calls this directly
no test coverage detected