MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / pool_return_entry

Function pool_return_entry

libavutil/refstruct.c:223–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223static 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
243static void pool_reset_entry(AVRefStructOpaque opaque, void *entry)
244{

Callers

nothing calls this directly

Calls 4

ff_mutex_lockFunction · 0.85
ff_mutex_unlockFunction · 0.85
pool_free_entryFunction · 0.85
pool_freeFunction · 0.85

Tested by

no test coverage detected